Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Listbox SelectedIndexChanged whit message box
 

Listbox SelectedIndexChanged whit message box

Iask before , but now I mor focus on the problem.
Ihave Listbox and Datagridview

The listbox have SelectedIndexChanged event and the datagridview have CellValidating event.

the SelectedIndexChanged fire find if thr user click on the list , but if the user is in edit mode in the table and then go to the list box to select new one . the CellValidating event open messagebox . when the user click on the message button the list box become float . when the mouse move the blue line is like nit focus .
I try to do focus to the list box but she already have.
I success to save the index of the selected index but I can't make it not to be fowl .

what can I do??????



Nissim Trabelsy
Nissim Trabelsy  Tuesday, September 08, 2009 11:56 AM
Hi Nissim Trabelsy,

We can call the BeginInvoke method to show the MessageBox, this would prevent the MessageBox stealing the focus.
You can get more information from this thread: http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/bb922f42-9737-4e94-a22f-a2ba80e3f095.

Let me know if this does not help.
Aland Li

Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
Aland Li  Thursday, September 10, 2009 8:22 AM
Hi Nissim Trabelsy,

We can call the BeginInvoke method to show the MessageBox, this would prevent the MessageBox stealing the focus.
You can get more information from this thread: http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/bb922f42-9737-4e94-a22f-a2ba80e3f095.

Let me know if this does not help.
Aland Li

Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
Aland Li  Thursday, September 10, 2009 8:22 AM

You can use google to search for other answers

Custom Search

More Threads

• VS 2005 Copy and Paste a Form in Solution Explorer
• Custom control derived from Control not responding to Click event
• virtual scroll ring
• Placing Windows Forms Controls on Internet Explorer
• Inherited Toolstrips cannot be Designed
• Property overide sets default property value to overided value.
• UITypeEditor for System.Type
• Class design question
• Creating Translucent Rectangle
• Moving from Java to C#