Inputpanel ArgumentException

  • Thread starter Thread starter smitz
  • Start date Start date
S

smitz

I got randomally an ArgumentException in "InPan.Enabled = True"

My GotFocusEvent of the textbox:
Private Sub EditField_GotFocus(ByVal sender As Object, ByVal e As
System.EventArgs)
If m_AutoKeyboard Then InPan.Enabled = True 'here comes the
argumentexception
End Sub

I'm using cf2 version 2.0.7045.0 with vs2005

StackTrace:
Microsoft.AGL.WindowsCE.MSWCE.InputPanelSetEnabled()
Microsoft.WindowsCE.Forms.InputPanel.set_Enabled()
BBmobil.DBPanel.EditField_GotFocus()
System.Windows.Forms.Control.OnGotFocus()
System.Windows.Forms.Control.WnProc()
System.Windows.Forms.Control._InternalWnProc()
Microsoft.AGL.Forms.EVL.EnterModalDialog()
System.Windows.Forms.Form.ShowDialog()
BBmobil.fMain.btnKundenAction_Click()
System.Windows.Forms.Control.OnClick()
System.Windows.Forms.Button.OnClick()
System.Windows.Forms.ButtonBase.WnProc()
System.Windows.Forms.Control._InternalWnProc()
Microsoft.AGL.Forms.EVL.EnterMainLoop()
System.Windows.Forms.Application.Run()
BBmobil.fMain.Main()

Any ideas???
 
When the debugger stops there, is InPan set to something? That is, are you
sure you aren't trying to set the Enabled property of an uninitialized
variable? Remember that the order in which messages are sent, particularly
during application startup, is not repeatable, generally.

Paul T.
 
Yes, the InPan is set to Enabled False.
When the debugger stops there I can change the enabled value without
problems (in the watching list).
Is it a problem that I'm using the gotfocus and lostfocus event
dynamic?
In my application I have a class inherits from panel.
In this class I can dynamicly create textboxes and link the got- and
lostfocus event of the created textbox to a sub like
EditField_GotFocus.
"AddHandler tb.GotFocus, AddressOf EditField_GotFocus"
"AddHandler tb.LostFocus, AddressOf EditField_LostFocus"
So when I create 5 textboxes they all run into EditField_GotFocus Sub
on GotFocus event.
In cf1 it works fine but in cf2 there are problems.
 
The most-likely connection with GotFocus/LostFocus is that it's quite
possible that the command you are giving to the input panel is changing the
focus again...

Paul T.
 
Back
Top