InputPanel vs TextBox.SelectAll()

  • Thread starter Thread starter Zanna
  • Start date Start date
Z

Zanna

Hi,

Why this code doesn't work

Private Sub txtCliente_GotFocus(ByVal sender As Object, ByVal e As
System.EventArgs) Handles txtCliente.GotFocus
InputPanel1.Enabled = True
DirectCast(sender, TextBox).SelectAll()
End Sub

I can see the SelectAll() "flashing" but it doesn't still active...

Thanks
 
i have just tested this, the sip pops up, what is the
problem or what do you want the program to do?

Private Sub TextBox2_GotFocus(ByVal sender As Object,
ByVal e As System.EventArgs) Handles TextBox2.GotFocus
InputPanel1.Enabled = True
DirectCast(sender, TextBox).SelectAll()
End Sub
 
marcmc said:
i have just tested this, the sip pops up, what is the
problem or what do you want the program to do?

Private Sub TextBox2_GotFocus(ByVal sender As Object,
ByVal e As System.EventArgs) Handles TextBox2.GotFocus
InputPanel1.Enabled = True
DirectCast(sender, TextBox).SelectAll()
End Sub

I don't have the TextBox2 get selected.

Bye
 
The click which causes TextBox to come into focus is processed *after* the
Focus event is sent. Correspondingly your SelectAll is reset. Very
annoying - the workaround would be to set a short timer in GotFocus and do
SelectAll on timer (and immediately disable timer after that)
 
Alex said:
The click which causes TextBox to come into focus is processed *after* the
Focus event is sent. Correspondingly your SelectAll is reset. Very
annoying - the workaround would be to set a short timer in GotFocus and do
SelectAll on timer (and immediately disable timer after that)


And there is no way to "pick" the click message and throw it away before
the SelectAll()?

Thanks
 
Back
Top