473,396 Members | 1,770 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.

VS 2005: Forms Designer Clears CancelButton and AcceptButton on Compile

I have a pretty standard Windows Form with 2 relevant buttons: btnOK
and btnCancel. I set both buttons' DialogResult properties
appropriately. I then set the form AcceptButton and CancelButton
properties appropriately. However, whenever I click the Play button,
the 2 properties get reset back to their defaults (nothing).

Does anyone have any idea why this might be happening? I'm
particularly annoyed because I got this right on another form and
cannot remember what I'm doing wrong.

Oct 2 '06 #1
3 1607
Josh Kodroff wrote:
Does anyone have any idea why this might be happening?
I followed through the steps just as you described on a form in VB2005, and
it didn't behave as you stated, the DialogResult properties were left
unchanged.

Are you finding that after you stop the project and examine the button
properties in the Properties window that they have both changed? Or are the
buttons just not behaving as you expect when you click on them?

--

(O)enone
Oct 2 '06 #2

Oenone wrote:
Josh Kodroff wrote:
Does anyone have any idea why this might be happening?

I followed through the steps just as you described on a form in VB2005, and
it didn't behave as you stated, the DialogResult properties were left
unchanged.

Are you finding that after you stop the project and examine the button
properties in the Properties window that they have both changed? Or are the
buttons just not behaving as you expect when you click on them?
Visual Studio is literally changing the AcceptButton and CancelButton
properties from the values I selected to blank. I've even tried
checking in the file to souce control, but to no avail.

My next idea is to manually write code for btnCancel that just sets the
DialogResult and hides the form, but I'm a little concerned that VS is
changing these settings without my say-so.

JK

Oct 3 '06 #3
To answer my own question, the issue was that I was using Form.Show and
not Form.ShowDialog from the calling form. However, I am still
perplexed as to why VS was changing those properties on my behalf.

I'm not going to stay awake at night worrying about it, though.

Josh Kodroff wrote:
Oenone wrote:
Josh Kodroff wrote:
Does anyone have any idea why this might be happening?
I followed through the steps just as you described on a form in VB2005, and
it didn't behave as you stated, the DialogResult properties were left
unchanged.

Are you finding that after you stop the project and examine the button
properties in the Properties window that they have both changed? Or are the
buttons just not behaving as you expect when you click on them?

Visual Studio is literally changing the AcceptButton and CancelButton
properties from the values I selected to blank. I've even tried
checking in the file to souce control, but to no avail.

My next idea is to manually write code for btnCancel that just sets the
DialogResult and hides the form, but I'm a little concerned that VS is
changing these settings without my say-so.

JK
Oct 3 '06 #4

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

Similar topics

0
by: bj7lewis | last post by:
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...
12
by: Capt_Ron | last post by:
Sorry to have to ask this but... I have a form that asks for SQL connection information. I want to close the form when I click Save and then open the login form. I can Hide the form but it...
0
by: fds | last post by:
Hello! I have a very specific question and that is about how to inherit a control for example the control System.Windows.Forms.TextBox without causing the environment to delete the control when...
0
by: Tony Johansson | last post by:
Hello! I have a very specific question and that is about how to inherit a visual control for example the control System.Windows.Forms.TextBox without causing the environment to delete the...
4
by: Chris Strug | last post by:
Hi there, Possibly something of a simple question but I was wondering is anyone could provide a few pointers or links. Given that I have two forms, a main (frmMain) and a child (frmChild)....
0
by: Karsten Sosna | last post by:
Hello NG, i have a problem with the AcceptButton in VB.Net and C#. I have an empty project with one form. On this form i take two buttons(Button1 and Button2). Now i set the the...
5
by: cj | last post by:
In 2003 I had Public Class Form1 Inherits System.Windows.Forms.Form In 2005 I've seen it with and without the Inherits System.Windows.Forms.Form. Is it supposed to be there? I'm wondering...
2
by: Peted | last post by:
Hi, im moving a project from vs2005 to vs 2008. is doing so i have come across a compiler error regarding partial classes that i dont understand if anyone can explain it to me please the...
12
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor, forward reference, sharing classes between forms....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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...
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
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...
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.