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

Access a form, using a string literal?

P: n/a
We have a question but we're in doubt if it's even possible or not.

The question is as follows:

Is it possible to access a form using a string literal, and if so yes?

We want to use something like this (don't mind the syntax as it obviously
doesn't work):

Form("Form1") frm = ("Form1")GetForm("Form1");

So we're able to access all the properties and methods of Form1 and not
just the methods and properties of the base class "Form".

Any help on this one is greatly appreciated!

Gerrit
Jan 26 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I would think you could try Reflection, for example, see
http://www.dotnetbips.com/articles/d...cle.aspx?id=35

but obviouly, you will lose the benefits of static type checking, code will
be hard to debug and the performance may even suffer

Anything else close will be something like dynamic identifiers in the
just-released VB 9 Linq CTP

"Gerrit Snel" wrote:
We have a question but we're in doubt if it's even possible or not.

The question is as follows:

Is it possible to access a form using a string literal, and if so yes?

We want to use something like this (don't mind the syntax as it obviously
doesn't work):

Form("Form1") frm = ("Form1")GetForm("Form1");

So we're able to access all the properties and methods of Form1 and not
just the methods and properties of the base class "Form".

Any help on this one is greatly appreciated!

Gerrit

Jan 26 '06 #2

P: n/a
Nothing like that will really work. I assume you are talking about running
code typed at runtime or something.
At design time you could just do:

Form1 frm = new Form1

That would give you access to all the properties and methods.

HTH

Ciaran
"Gerrit Snel" <gs*************@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
We have a question but we're in doubt if it's even possible or not.

The question is as follows:

Is it possible to access a form using a string literal, and if so yes?

We want to use something like this (don't mind the syntax as it obviously
doesn't work):

Form("Form1") frm = ("Form1")GetForm("Form1");

So we're able to access all the properties and methods of Form1 and not
just the methods and properties of the base class "Form".

Any help on this one is greatly appreciated!

Gerrit

Jan 26 '06 #3

P: n/a
OK, thank you all
I try something else i think

"Ciaran" <ci****@theodonnells.plus.com> schreef in bericht
news:43**********************@ptn-nntp-reader02.plus.net...
Nothing like that will really work. I assume you are talking about running
code typed at runtime or something.
At design time you could just do:

Form1 frm = new Form1

That would give you access to all the properties and methods.

HTH

Ciaran
"Gerrit Snel" <gs*************@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
We have a question but we're in doubt if it's even possible or not.

The question is as follows:

Is it possible to access a form using a string literal, and if so yes?

We want to use something like this (don't mind the syntax as it obviously
doesn't work):

Form("Form1") frm = ("Form1")GetForm("Form1");

So we're able to access all the properties and methods of Form1 and not
just the methods and properties of the base class "Form".

Any help on this one is greatly appreciated!

Gerrit


Jan 27 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.