I am setting focus to combobox as combobox.select() in a thread by using the delegate. But only after changing the ALT+TAB to another window the combobox is getting focused.

How to solve this problem...

Please help me...

Thanks in advance...

The code is here...

Private Delegate Sub cmbusersetfocus()
Private Sub combouser()
If Me.InvokeRequired Then
' if operating on a thread, invoke a delegate
' on the UI thread.
Dim omd As cmbusersetfocus = New cmbusersetfocus(AddressOf combouser)
Dim arx As IAsyncResult = Me.BeginInvoke(omd)

If cmbuser.Focus = False Then


End If


' End If



End If
End Sub

9 Years
Discussion Span
Last Post by tmani_85

yea I tried combobox.focus But it doesnt work for me...
Is there any other way to bring the focus back to combobox ..



I don't need to focus the combobox not in the load... I need to do it after doing some process in thread...

After that a message box appears at the end of the thread... After clicking the ok button in the message box i need to focus the combobox...

At the end of the thread i need to focus it...
So i am using the delegate function to focus the combobox....

After going to some other window only it's get focusing...

When i do the ALT+TAB and go to some other window and when i come back to the form its getting focused....

Please help me....

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.