You are not logged in.

scGuy

Beginner

  • "scGuy" started this thread

Posts: 40

Date of registration: Jan 12th 2011

  • Send private message

1

Monday, January 17th 2011, 5:23pm

Form Name Property not available at runtime

When you create a form, you can give it a name in the form properties. However in code, the "name" property is not available as expected. So including something like "If MyForm.Name = something then" does not compile.



Quick test is to open new SDI application, add command button and include this line of code in click event:



Msgbox Form1.Name

A1880

Intermediate

  • "A1880" is male

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

2

Tuesday, January 18th 2011, 8:07am

"Name" is not a property but rather the name of the variable.
You could declare a public member variable of the form to assign a name string to the form.

Greetings

A1880

scGuy

Beginner

  • "scGuy" started this thread

Posts: 40

Date of registration: Jan 12th 2011

  • Send private message

3

Tuesday, January 18th 2011, 4:34pm

What you say makes sense, and your work around is easy. As a compatibility issue for importing VB6 code, VB does treat the variable name as a read-only property, and many vb programmers have used it (myself included) for odd things in applications. If name could be presented in Jabaco the same way, it would make for easier project imports, but definitely not a major issue.

Rate this thread
WoltLab Burning Board