473,406 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Problem in focusing default button

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
1 1148
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Patrick | last post by:
Hi I am fairly new to CSS and the web.I am trying to build a site more to practice my skills than for the site itself. I have been focusing on CSS and try my best to make it work in I.E 6.0,...
0
by: Shixx | last post by:
Hello, I have problem in my web application and my web form. I have 5-6 buttons (web controls) and when I have focus on some text box, always one button becomes default and got focus, and after I...
1
by: Richard Brand | last post by:
We run into a strange problem with a client when printing a frame from a website. On the site there is a button that performs the following javascript code: parent.myFrame.focus();...
2
by: Chris Bolus | last post by:
I'm a teacher using MS Access on an RMConnect 2.4 network. On some workstations both I and my students sometimes get an error message when attempting to insert a command button on a form which...
1
by: Kris van der Mast | last post by:
Hi, been a while since I posted a question myself instead of trying to help others out. I'm refactoring an existing web app that uses dynamic loading of user controls and a lot of...
30
by: dbuchanan | last post by:
ComboBox databindng Problem == How the ComboBox is setup and used: My comboBox is populated by a lookup table. The ValueMember is the lookup table's Id and the DisplayMember is the text from a...
1
by: RajaRengham | last post by:
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...
1
by: funfair | last post by:
HI,EVERY ONE first problem, i have create a database in access 2003 it worked fine untill i have format my laptop . now im working on office 2003 on windows xp and i have norton 2006 but im...
3
by: Steven | last post by:
I have a question about the focusing on windows form control. First of all, I have a main windows form (MainFrm) for my application, another form (NewFrm) will be displayed if pressing one of the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.