Hello.
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:
[CODE=vb]Private Sub SelectExCombo_K eyDown(ByVal sender As System.Object, ByVal e As System.Windows. Forms.KeyEventA rgs) Handles MyBase.KeyDown
If (e.KeyCode = System.Windows. Forms.Keys.Up) Then
If CheckBox1.Focus ed Then
Panel1.BackColo r = color.white
Panel2.BackColo r = Color.Blue
CheckBox9.Focus ()
GoTo handled
ElseIf CheckBox9.Focus ed = True Then
Panel1.BackColo r = Color.Blue
Panel2.BackColo r = color.white
CheckBox1.Focus ()
GoTo handled
End If
End If
If (e.KeyCode = System.Windows. Forms.Keys.D1) Then
If CheckBox1.Focus ed Then
If CheckBox1.Check State = CheckState.Unch ecked Then
CheckBox1.Check State = CheckState.Chec ked
ElseIf CheckBox1.Check State = CheckState.Chec ked Then
CheckBox1.Check State = CheckState.Unch ecked
GoTo handled
End If
ElseIf CheckBox9.Focus ed Then
If CheckBox9.Check State = CheckState.Unch ecked Then
CheckBox9.Check State = CheckState.Chec ked
ElseIf CheckBox9.Check State = CheckState.Chec ked Then
CheckBox9.Check State = CheckState.Unch ecked
GoTo handled
End If
End If
End If
[/CODE]
Any guidance would be greatly appreciated.
ershn
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:
[CODE=vb]Private Sub SelectExCombo_K eyDown(ByVal sender As System.Object, ByVal e As System.Windows. Forms.KeyEventA rgs) Handles MyBase.KeyDown
If (e.KeyCode = System.Windows. Forms.Keys.Up) Then
If CheckBox1.Focus ed Then
Panel1.BackColo r = color.white
Panel2.BackColo r = Color.Blue
CheckBox9.Focus ()
GoTo handled
ElseIf CheckBox9.Focus ed = True Then
Panel1.BackColo r = Color.Blue
Panel2.BackColo r = color.white
CheckBox1.Focus ()
GoTo handled
End If
End If
If (e.KeyCode = System.Windows. Forms.Keys.D1) Then
If CheckBox1.Focus ed Then
If CheckBox1.Check State = CheckState.Unch ecked Then
CheckBox1.Check State = CheckState.Chec ked
ElseIf CheckBox1.Check State = CheckState.Chec ked Then
CheckBox1.Check State = CheckState.Unch ecked
GoTo handled
End If
ElseIf CheckBox9.Focus ed Then
If CheckBox9.Check State = CheckState.Unch ecked Then
CheckBox9.Check State = CheckState.Chec ked
ElseIf CheckBox9.Check State = CheckState.Chec ked Then
CheckBox9.Check State = CheckState.Unch ecked
GoTo handled
End If
End If
End If
[/CODE]
Any guidance would be greatly appreciated.
ershn
Comment