473,587 Members | 2,412 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")GetFor m("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 1621
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")GetFor m("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******** ********@TK2MSF TNGP10.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")GetFor m("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****@theodon nells.plus.com> schreef in bericht
news:43******** **************@ ptn-nntp-reader02.plus.n et...
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******** ********@TK2MSF TNGP10.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")GetFor m("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
2005
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 tblZoneShippingRates WHERE ZoneName = "Australia" AND WeightCategory = "250"
4
7447
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 placeholder,the user selects the required tags from the dropdownlists (if 5 Xml tags,then 5 dropdownlists each containing 5 xml tags) and now the...
43
2204
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 in a Text.LostFocus event, this block: Do While Not TB6.EOF If Year(TB6(0)) = Val(Trim(Text1.Text)) Then !!!!!!!!!!!!!Here!!!!!!!!! ...
2
2525
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 me, to slove this issue i pasted code below Microsoft.Office.Interop.Excel.Application ObjExcel = new...
2
3375
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 fine, but the LIKE statement is the problem, I can't figure out how to get the quotes around the like such as '*Sheriff*' Any help would be great. ...
0
7918
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7843
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8206
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7967
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6621
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5392
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2353
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 we have to send another system
1
1452
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.