473,396 Members | 1,859 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,396 software developers and data experts.

Quest: Setting Dlg Forms' OK & Cancel Buttons Correctly...

I have two modal dlg forms that are invoked(seperately) by a main form but
the two modal dlg forms don't close when clicking the OK & Cancel buttons
setup as below...

Here the setup...

//In MainForm.cs...
//I Don't want the main form to close with enter and esc keys...
MainForm.AcceptButton = None; //Not in code...
MainForm.CancelButton = None; //Not in code...

//I use ExitApp button to exit app...
....
void ExitApp_Click(...)
{
Close();
}

//In My1stDlgForm.cs...
//I Do want the main form to close with enter and esc keys...
OKDlgButton.DialogResults = ....OK;
CancelDlgButton.DialogResults = ....Cancel;
....
My1stDlgForm.AcceptButton = OKDlgButton;
My1stDlgForm.CancelButton = CancelDlgButton;

//In My2ndDlgForm.cs...
//I Only want the form to close with enter keys...
OKDlgButton.DialogResults = ....OK;
....
My2ndDlgForm.AcceptButton = OKDlgButton;
My2ndDlgForm.CancelButton = ...None;

Note: End of codes above...

The program builds and runs but doesn't close. I have other C# programs that
the button worked and check the codes above with the old program an
everything matchs up...

Where else do I look to set this up...

Any help...
Nov 17 '05 #1
0 2021

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Terrance | last post by:
Good Afternoon: I was hoping if someone could share some light on a problem that I'm facing. When I create a Visual Basic.Net program and I use the XP style for my Window Forms and buttons; if I...
1
by: Zaidan | last post by:
I am running Excel2000 under WIN98 2nd edition, and I am writing a VBA code (I will consider using javascript if I have to) that does the following, at the user command: 1- Start MS Explorer and...
1
by: Samuel Hon | last post by:
Hi All I'm trying to add an Save/Cancel feature to my forms so that users can make changes and then reverse them if they so decide. I've disabled the close button and blocked the Alt-F4...
7
by: Mark Thiel | last post by:
I am working on a project for my company, which has a structure of six major areas. Certain people need to have access to all of the data, whereas other people only require access to the...
3
by: CSDunn | last post by:
Hello, I currently have an Access 2003 ADP Report/Subreport set up in which I have 12 subreports in a single main report that are located in a group header called 'PermnumHeader' (Permnum would be...
6
by: Patrick Coghlan | last post by:
I want to create about 4 forms with the same dimensions and background colours, similar to the forms one has to traverse when installing various software packages. I'm using Visual Studio and...
6
by: AMeador | last post by:
I have a form where a user will check boxes next to items that have been completed. They will click a button on the form to mark the items as completed. When they do this, I will have the 'parent'...
0
by: Steve Kallal | last post by:
I have a DataGrid with an EditCommandColumn column set to a type of PushButton. I want to set set CssClass on these buttons and cannot without using code-behind code on the ItemDataBound event. The...
3
by: Brian Henry | last post by:
Hi, I have a bunch of forms in a DLL that I call from my main application. The one form is a login form, and I have the tab order set in the order I want it (password box first, then ok button...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.