Click here to Skip to main content
15,897,273 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
i want that when a message box open having two option buttons YES and No, the default "No button option" is already set, means the focus of tab already on "No button" ..


if any one know how to code this please tell me.............
Posted
Comments
Sergey Alexandrovich Kryukov 13-Sep-11 17:01pm    
Tag it, always! WPF, Silverlight, ASP.NET, Forms, what?
--SA

1 solution

Let's assume for a minute this is System.Windows.Forms. :-)

There are several System.Windows.Forms.MessageBox.Show; you will see them all here: http://msdn.microsoft.com/en-us/library/system.windows.forms.messagebox.show.aspx[^]. Chose the methods having parameter of the type System.Windows.Forms.MessageBoxDefaultButton, see http://msdn.microsoft.com/en-us/library/system.windows.forms.messageboxdefaultbutton.aspx[^].

This parameter will let you specify what button gets initial focus.

—SA
 
Share this answer
 
v2
Comments
[no name] 13-Sep-11 17:55pm    
thnx for link.........my problem is solved.........
Sergey Alexandrovich Kryukov 13-Sep-11 19:09pm    
Sure, you're welcome.
Good luck, call again.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900