By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 915 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

Problem in focusing default button

P: n/a
Hi all

Please have a look at the following code. problem with this is
when the button1_click is initiated by keyborad it works well. But when it is initiated by mouse,focus on the default button is missing. Is there any problem with MessageBox Class

private void button1_Click(object sender, System.EventArgs e
MessageBox.Show("Message","Title",MessageBoxButton s.YesNo,MessageBoxIcon.Asterisk,MessageBoxDefaultB utton.Button2)

Thanks in advance

Regards
RR.
Jul 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
RR

I tried the code copied from your email into a C# form and clicked on the

button with the mouse. The No button get the focus in the display of the

message box. There must be something else going on. There is nothing wrong

with the way the MessageBox is written or works in a test project.

Sorry, I can't be of more help.

Les Smith

See articles, free code, add-ins, books, general .NET info at

http://www.knowdotnet.com

"RajaRengham" <an*******@discussions.microsoft.com> wrote in message
news:D6**********************************@microsof t.com...
Hi all,

Please have a look at the following code. problem with this is,
when the button1_click is initiated by keyborad it works well. But when it is initiated by mouse,focus on the default button is missing. Is there any
problem with MessageBox Class.

private void button1_Click(object sender, System.EventArgs e)

{
MessageBox.Show("Message","Title",MessageBoxButton s.YesNo,MessageBoxIcon.Ast
erisk,MessageBoxDefaultButton.Button2);
}
Thanks in advance.

Regards,
RR.

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.