| | |
Combobox Focus
Please support our VB.NET advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Feb 2009
Posts: 13
Reputation:
Solved Threads: 2
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)
Me.EndInvoke(arx)
If cmbuser.Focus = False Then
cmbuser.Select()
End If
'cmbuser.Focus()
'Form1.Activate()
' End If
'MsgBox("test")
Return
End If
End Sub
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)
Me.EndInvoke(arx)
If cmbuser.Focus = False Then
cmbuser.Select()
End If
'cmbuser.Focus()
'Form1.Activate()
' End If
'MsgBox("test")
Return
End If
End Sub
Did you try
ComboBox.Focus() BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Put
ComboBox.Select(); in the form_load event handler. BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
•
•
Join Date: Feb 2009
Posts: 13
Reputation:
Solved Threads: 2
Thanks.....
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....
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....
![]() |
Similar Threads
- Understanding the BackgroundWorker Process (VB.NET)
- Creating a new file type - and creating Search function (C#)
- Bug in editable JComboBox? (Java)
- Help with automatic update problem and more (Viruses, Spyware and other Nasties)
- Cannot find server or DNS Error - please help! (Viruses, Spyware and other Nasties)
- about combo box (Visual Basic 4 / 5 / 6)
- Clearing a combobox upon selection/focus (Java)
- Help! What Language is this? (Assembly)
- combo box help (VB.NET)
Other Threads in the VB.NET Forum
- Previous Thread: locating remote machine name
- Next Thread: Need suggestion
Views: 990 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
"crystal .net .net2005 30minutes 2008 access add application array assignment basic binary box button buttons center click code connectionstring convert cpu data database databasesearch datagrid datagridview design designer dissertation dissertations dissertationthesis dll dosconsolevb.net editvb.net employees error excel exists firewall folder image images isnumericfuntioncall listview login math memory mobile module msaccess mssqlbackend mysql navigate net opacity page pan peertopeervideostreaming picturebox plugin port print printing printpreview problem record refresh regex reports" reuse save savedialog serial sorting sql sqldatbase storedprocedure string structures studio temp textbox timer upload useraccounts usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet vista visual visualbasic visualbasic.net visualstudio2008 web wpf xml






