why do i get a type mismatch? :confused:VB Code:
If Not txtSend.SelStart = "" Then
also, thats the method im using to check if the control is in focus - is there another way to check if a control is focussed?
Printable View
why do i get a type mismatch? :confused:VB Code:
If Not txtSend.SelStart = "" Then
also, thats the method im using to check if the control is in focus - is there another way to check if a control is focussed?
Because SelStart is looking for a number
VB Code:
bRTBoxHasFocus As Boolean Private Sub RichTextBox1_GotFocus() bRTBoxHasFocus = False End Sub Private Sub RichTextBox1_LostFocus() bRTBoxHasFocus = True End Sub
bRTBoxHasFocus will be true if the richtextbox has focus, false if not.
could u use that ?
This probably isn't what you are looking for, but Screen.ActiveControl.Name will get you the name of the control that has the focus.
Peet.... I'm afraid to say that your events are swapped.Quote:
Originally posted by peet
VB Code:
bRTBoxHasFocus As Boolean Private Sub RichTextBox1_GotFocus() bRTBoxHasFocus = False End Sub Private Sub RichTextBox1_LostFocus() bRTBoxHasFocus = True End Sub
bRTBoxHasFocus will be true if the richtextbox has focus, false if not.
could u use that ?
.... or the settings for the boolean
oops... thanks Mc Brain :)