By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,023 Members | 1,297 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,023 IT Pros & Developers. It's quick & easy.

VS 2005: Forms Designer Clears CancelButton and AcceptButton on Compile

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a

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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.