2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
Handle the Shift and Ctrl keyTo know whether the CTRL or SHIFT key is currently down or not, you can find out by using the following codes. C# void gridControl1_MouseDown(object sender, MouseEventArgs e) { // Checks whether the Ctrl key is down. if ((Control.ModifierKeys & Keys.Control) != 0) { Console.WriteLine("Control Key is down"); } //Checks whether the Shift key is down. if ((Control.ModifierKeys & Keys.Shift) != 0) { Console.WriteLine("Shift Key is down"); } } VB Private Sub gridControl1_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) 'Checks whether the Ctrl key is down. If (Control.ModifierKeys And Keys.Control) <> 0 Then Console.WriteLine("Control Key is down") End If 'Checks whether the Shift key is down. If (Control.ModifierKeys And Keys.Shift) <> 0 Then Console.WriteLine("Shift Key is down") End If End Sub
Figure 1: Grid Control with Shift and Control keys handling Samples: |
2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
This page will automatically be redirected to the sign-in page in 10 seconds.