changing text in the form title bar....compile and runtime error

G

Guest

The last line in my Main() section is:

form1.ShowDialog()

The form appears, using the tile bar set in the properties window of the
form designer.

In the middle of form1, in one of my subs, I wish to change the tile bar or
the form.

I was using this line without problems:

'Form.ActiveForm.Text() = "======== New Text here ========"

I must have changed something elsewhere because not I get a compile error at
the above line.

Does the form have to be activated/inactived made visible?

Where should I look in troubleshooting this?

thanx......Joisey
 
C

Chris Dunaway

What is the error? Where is 'Form' defined? If this is in the middle
of your form1, why can't you use Me.Text?
 
H

Herfried K. Wagner [MVP]

The last line in my Main() section is:

form1.ShowDialog()

Use 'Application.Run(New Form1())' instead.
The form appears, using the tile bar set in the properties window of the
form designer.

In the middle of form1, in one of my subs, I wish to change the tile bar
or the form.

I was using this line without problems:

'Form.ActiveForm.Text() = "======== New Text here ========"

Use 'Me.Text' instead. 'Me' will return a reference to the instance of the
form that contains the code that is executing. Notice that you don't need
'()' here -- 'Text' is a property.
 

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