Tuesday, March 20, 2012

VB.NET - Show Hidden Form Elements with a Keyboard Shortcut

I created a keyboard shortcut to show form elements that aren't quite production ready:

Private Sub showHiddenElementsByKeyboardCombo(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
If (e.KeyCode = Keys.H AndAlso e.Modifiers = Keys.Control AndAlso e.Modifiers = Keys.Alt) Then
MsgBox("The keyboard shortcut you used is about to allow you to see hidden features which have not been fully tested. If this was not your intention, close the tab and re-open it.")
dropDown1.Visible = True
dropDown2.Visible = True
dropDown3.Visible = True
End If
End Sub