System.Windows.Forms.ContainerControl.ProcessTabKey(bool)

Here are the examples of the csharp api class System.Windows.Forms.ContainerControl.ProcessTabKey(bool) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Example 7

1. Example

View license
protected override bool ProcessTabKey(bool forward)
		{
			// overrides the tab order using the focus delegates list
			int indexFocusedControl = 0;
			while (indexFocusedControl < _focusDelegates.Count)
			{
				// find the control that is currently focused
				if (_focusDelegates[indexFocusedControl].Key.ContainsFocus)
				{
					// try to focus the next control in sequence
					for (int offset = 1; offset < _focusDelegates.Count; offset++)
					{
						int index = (indexFocusedControl + (forward ? offset : _focusDelegates.Count - offset))%_focusDelegates.Count;
						if (_focusDelegates[index].Value.Invoke(forward))
							break; // end loop on first control that successfully focused
					}
					return true;
				}
				indexFocusedControl++;
			}
			return base.ProcessTabKey(forward);
		}