473,804 Members | 3,424 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

I have two modal dlg forms that are invoked(seperat ely) 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.Accept Button = None; //Not in code...
MainForm.Cancel Button = 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.Dia logResults = ....OK;
CancelDlgButton .DialogResults = ....Cancel;
....
My1stDlgForm.Ac ceptButton = OKDlgButton;
My1stDlgForm.Ca ncelButton = CancelDlgButton ;

//In My2ndDlgForm.cs ...
//I Only want the form to close with enter keys...
OKDlgButton.Dia logResults = ....OK;
....
My2ndDlgForm.Ac ceptButton = OKDlgButton;
My2ndDlgForm.Ca ncelButton = ...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 2037

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

Similar topics

9
3505
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 add images to my menu buttons they don't show when the form is created. But, if I don't use the XP style the images show on my buttons correctly. Can someone please explain to me what the problem is and how to get around it? Here is how I'm calling...
1
3797
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 go to my website. Login (enter ID and Password) 2- It will go and update some prices of some products that I sell 3- It will add new products or cancel some product I already have someone who wrote me in JavaScript a web form (no documentation...
1
1601
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 combination so that the only way to exit the form is to the use the Save/Cancel buttons The Save button is straight-forward using DoCmd.Close....
7
1963
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 information for one area. Since the users do not know Access, I created a form to make it easy to generate a report. Is it possible, either when the database is initially opened or when the user clicks on the command button to execute the report, to...
3
4901
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 the same as a numeric 'StudentID'). All subreports initially have their visible property set to 'No'. I have a macro that evaulates the current value of a field in the detail section of the main report called 'Grade' and a field in the same...
6
2241
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 C++ (changing to C# soon) and can create separate forms, but I really just want to clone the first one, have the user select different options on each form and navigate between them via the PREV-NEXT-OKAY-CANCEL buttons on the bottom of the form. ...
6
1477
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' form instantiate another form where the details of this completed event will be entered. Once the data is entered on this 'child' form, the data entered should be updated/added to the database. The 'child' form also has 'Cancel' and 'Cancel All'...
0
1469
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 project lead does not want me to do this with code as he thinks it is too complex. But I cannot find a property in Design View or HTML View that works. Otherwise the edit buttons do not match the appearance of other buttons on the screen. Here is...
3
5629
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 then cancel button then database selection combo box then user name text box, then back to password text box) now the password, user name and database entry's are in a group box frame. the buttons (Ok and Cancel) are outside the group frame. Now...
0
9589
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10340
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10329
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
9163
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7626
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
6858
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
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4304
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
3830
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.