473,385 Members | 1,546 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,385 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 1146
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...

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.