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

Form.AcceptButton inconsistency

Hello all.

I'm trying to figure out exactly what is going on here. I'm getting
different results on different forms, and it's driving me nuts.

For example, I have a form called FormFinish. It's AcceptButton is set
to btnExport and the CancelButton is set to btnCancel.

btnExport on FormFinish has no event code whatsoever (not even for
click.) When the user either clicks the button or presses enter on the
form, it is closed and the DialogResult property is set to
DialogResult.OK automatically.

I have another form with an AcceptButton and a CancelButton. Neither of
these buttons have code for the click events either. (The only code that
even exists for this form is to change the Text of a label, and the
generated code) Pressing escape or clicking cancel will close the form,
as it does on the other. This is not the case for the AcceptButton. If I
add DialogResult = DialogResult.OK to the AcceptButton's click event,
then it does close.

So why does one form not require any code for the click event for the
button designated as the AcceptButton, yet the other form does require
it? I'm really confused here.

Thanks,
Jeff
Nov 21 '05 #1
1 1769
Nevermind! I just realized I had set the DialogResult property on one of
the buttons, but not the other. Duh.

Jeff
Nov 21 '05 #2

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

Similar topics

3
by: RubiconXing | last post by:
Hi All Beginner question - please be patient with me :-) I am new to c#. If one creates a child modal (and also non-modal) form what is the best way of returning the collected data back to the...
3
by: Hsg | last post by:
Hi all.. in C# , and specally in Forms ... i had creat a form , the user enter Inputs , and then press the Button ... is there a way that the user will have teh choice to press the Button on...
9
by: Ale K. | last post by:
What's the best way to make a form return a value.... i want to try to avoid using module variables for doing this... Thanks. Alex.
6
by: bole2cant | last post by:
The error I get is: Cannot access a disposed Object named "Form2". Object name "Form2". Here is the sequence which gives the error. Start program. Form1 comes up and has a button to choose...
2
by: Wardeaux | last post by:
All, I have login form used with ShowDialog(). I have the AcceptButton property set so that the "Enter" key is mapped. I also need to keep the dialog open when the UserID and PWD are invalid so...
2
by: Barney | last post by:
Hi, This is my first query in google groups. I expect to donīt do it wrong, and excuse me for my english, i havenīt used it for years... Iīm making a user component that inherits from a textbox....
2
by: sonicm | last post by:
Hi, I have a search for where we want the user to enter the search criteria in at the top and press enter, then the results are shown in a datagrid which we set the focus to. Once they select...
1
by: Al Biheiri | last post by:
how do i create an AcceptButton in c# user presses enter on textbox = button1.click something like AcceptButton = button1
2
by: sravan_reddy001 | last post by:
i had designed a win app(an address book) when the user wants to enter the contact he will type in all the details and "HE SHOULD CLICK ON THE ADDENTRY BUTTON PROVIDED" i want to simplify this...
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
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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: 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...

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.