473,699 Members | 2,579 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(o bject sender, System.EventArg s e
MessageBox.Show ("Message","Tit le",MessageBoxB uttons.YesNo,Me ssageBoxIcon.As terisk,MessageB oxDefaultButton .Button2)

Thanks in advance

Regards
RR.
Jul 21 '05 #1
1 1170
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

"RajaRengha m" <an*******@disc ussions.microso ft.com> wrote in message
news:D6******** *************** ***********@mic rosoft.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(o bject sender, System.EventArg s e)

{
MessageBox.Show ("Message","Tit le",MessageBoxB uttons.YesNo,Me ssageBoxIcon.As t
erisk,MessageBo xDefaultButton. 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
5167
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, Opera 7.23, Mozilla 1.4 and N.N. 7.1. My site was doing fine until i read i was supposed to keep everything validated so i entered a strict html 4.01 doctype with url following.My HTML validated fine. So i validated my CSS and beside a little...
0
1864
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 write something in text box and press Enter I invoke that button method ?!?! But this is not button I want to be default. I set tab orders and nothing always that button becomes default when I am on some text box on web form. How can I set default...
1
1809
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(); window.print(); This is the normal way to print a specific frame from a website. Our client works on a SBS2003 with Terminal Server and when they hit the button all frames are printed out, not just the selected one. At first I thought that
2
9287
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 reads "Invalid use of null". The remainder of the options in the Command Button Wizard are then unavailable and the button wil not work. The only solution is to log on to a different workstation. Any ideas?
1
2315
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 response.redirects to the same page. Because I hate the overhead by doing this I'm searching for a cleaner option. But I'm having troubles (off course or I wouldn't be posting this).
30
4583
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 corresponding field in the lookup table. In my data table we store the ID in what I will call the 'key' field. == Description of the desired operation:
1
280
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 is missing. Is there any problem with MessageBox Class private void button1_Click(object sender, System.EventArgs e MessageBox.Show("Message","Title",MessageBoxButtons.YesNo,MessageBoxIcon.Asterisk,MessageBoxDefaultButton.Button2)
1
1639
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 facing a problem in opening some forms from command button a message appear the openform action was canceled and when i open them from the database window(form) there are problem in open event or change event or activate event the same file is work...
3
1022
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 button on the MainFrm. I used the NewFrm.Show() method to open the form. However, if I switch the focus to another applcation (eg. Outlook, IE etc) and then switch back to my application program. I lost the focus on NewFrm and MainFrm display on...
1
8911
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8882
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6533
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5872
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4375
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3057
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2345
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2009
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.