473,513 Members | 2,476 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access a form, using a string literal?

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
3 1611
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2002
by: Penny | last post by:
Hi all, Thanks again guys for the help re Select Case. I might trouble you with something else: I use this SQL in the Access query builder to return a single AirRate: SELECT AirRate FROM...
4
7443
by: theo | last post by:
Program flow...load file,then extract the xml text tags from the file,then the number of Xml tags retrieved from the file determines the number of dropdownlist controls instanciated in the...
43
2180
by: ZillionDollarSadist | last post by:
Hello, I'm working at a simple Access '97 + VB4 application, and I ran into a terrible problem: something I never modified now gives me a totally unwanted "Invalid use of null" error. It happens...
2
2520
by: harichinna | last post by:
Hi to all, My name is hari, iam trying to delete the column value of spread sheet using c sharp, iam trying to get the value and compare, when comparing it showing some errors, can any one help...
2
3370
by: dbonin1599 | last post by:
I have the following code, the first set of code is the SQL version, the second set of code is an attempt to put the code into a VB String see "UpdateVariations". I need help, I think most of it is...
0
7260
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7384
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7101
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5686
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4746
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3234
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3223
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1597
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.