Showdialog from 1.0 to 1.1 framework - form.text = "" and controlbox = false

D

Dan M

Hi,

Upgraded a 1.0 project to 1.1. Had a form that I opened with ShowDialog.
ControlBox set to false at designtime and I set caption in the form load
(me.text="my title"). This worked fine in 1.0. However in 1.1 if I set the
me.text = "" (an empty string), the form would immediately close returning
a dialogresult = Cancel. It looks like you can't set the me.text
property at runtime to "" when you don't have a controlbox unless its in the
New sub for the form.

Not a big deal now that I have figured it out but hopefully someone might
read this and not pull their hair out for a couple hours over why their form
closes immediately.

Regards,

Dan
 
H

Herfried K. Wagner [MVP]

* "Dan M said:
Upgraded a 1.0 project to 1.1. Had a form that I opened with ShowDialog.
ControlBox set to false at designtime and I set caption in the form load
(me.text="my title"). This worked fine in 1.0. However in 1.1 if I set the
me.text = "" (an empty string), the form would immediately close returning
a dialogresult = Cancel. It looks like you can't set the me.text
property at runtime to "" when you don't have a controlbox unless its in the
New sub for the form.

Does this even occur in a blank VS.NET 2003 project?
 
D

Dan

Do you mean a new project in 2003 rather than an upgraded one?

If you so then yes - did a majority of my debugging using a new project with
2 forms (a startup and the modal one).
 
H

Herfried K. Wagner [MVP]

* "Dan said:
Do you mean a new project in 2003 rather than an upgraded one?
Yes.

If you so then yes - did a majority of my debugging using a new project with
2 forms (a startup and the modal one).

OK. Thank you for this information. Currently I don't have VS.NET 2003
here, so I cannot check it :-(.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top