I'm writing a windows mobile 2003 project for smartphone in vb.net. Using vs2003 compact framework 1.0. In most attempts on my forms I cannot get the keydown event to fire. I'm basically trying to check and uncheck checkboxes using the number keys. Here is a typical sub I'm using:
Expand|Select|Wrap|Line Numbers
- Private Sub SelectExCombo_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
- If (e.KeyCode = System.Windows.Forms.Keys.Up) Then
- If CheckBox1.Focused Then
- Panel1.BackColor = color.white
- Panel2.BackColor = Color.Blue
- CheckBox9.Focus()
- GoTo handled
- ElseIf CheckBox9.Focused = True Then
- Panel1.BackColor = Color.Blue
- Panel2.BackColor = color.white
- CheckBox1.Focus()
- GoTo handled
- End If
- End If
- If (e.KeyCode = System.Windows.Forms.Keys.D1) Then
- If CheckBox1.Focused Then
- If CheckBox1.CheckState = CheckState.Unchecked Then
- CheckBox1.CheckState = CheckState.Checked
- ElseIf CheckBox1.CheckState = CheckState.Checked Then
- CheckBox1.CheckState = CheckState.Unchecked
- GoTo handled
- End If
- ElseIf CheckBox9.Focused Then
- If CheckBox9.CheckState = CheckState.Unchecked Then
- CheckBox9.CheckState = CheckState.Checked
- ElseIf CheckBox9.CheckState = CheckState.Checked Then
- CheckBox9.CheckState = CheckState.Unchecked
- GoTo handled
- End If
- End If
- End If
ershn