System.Windows.Forms.TabControl.NavigateTabs C# (CSharp) Method

NavigateTabs() private method

private NavigateTabs ( Keys keycode ) : bool
keycode Keys
return bool
		private bool NavigateTabs (Keys keycode)
		{
			bool move_left = false;
			bool move_right = false;
			
			if (alignment == TabAlignment.Bottom || alignment == TabAlignment.Top) {
				if (keycode == Keys.Left)
					move_left = true;
				else if (keycode == Keys.Right)
					move_right = true;
			} else {
				if (keycode == Keys.Up)
					move_left = true;
				else if (keycode == Keys.Down)
					move_right = true;
			}
				
			if (move_left) {
				if (SelectedIndex > 0) {
					SelectedIndex--;
					return true;
				}
			}
			
			if (move_right) {
				if (SelectedIndex < TabCount - 1) {
					SelectedIndex++;
					return true;
				}
			}
			
			return false;
		}
		#endregion