473,385 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Access a method on a form

I am currently trying to access a method in a form that modifies the
properties of controls on that form.
I can't instantiate the form otherwise i will get a duplicate. Is there a
way to do this?
Nov 15 '05 #1
3 993
Your question is not clear.. as I got it

private MyForm lobjFrm;

I think you can define the form object to be private as a global variable in
your class and in your method which you use to display the form you can do
some thing like

if (lobjFrm == null)
lobjFrm = new MyForm();

lobjFrm.Show();

if I assume that you need to access the method "myMethod()" to do the
property updating

lobjFrm.myMethod()

will do it

Nirosh.

"Merlynx" <no****@home.com> wrote in message
news:ew**************@TK2MSFTNGP09.phx.gbl...
I am currently trying to access a method in a form that modifies the
properties of controls on that form.
I can't instantiate the form otherwise i will get a duplicate. Is there a
way to do this?

Nov 15 '05 #2
Merlynx <no****@home.com> wrote:
I am currently trying to access a method in a form that modifies the
properties of controls on that form.
I can't instantiate the form otherwise i will get a duplicate. Is there a
way to do this?


See http://www.yoda.arachsys.com/csharp/...rms.parameters - it's
much the same principle.

Basically, if you want to do something with a form, you've got to have
a reference to it, just like any other object.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #3
Hi Merlynx,

What do you mean you get a duplicate?
I suppose the form is already instantiated, so you only need a reference
to it.
Is this a static property? Otherwise you will need an instance.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Frances | last post by:
Hi All, * PREMISE * I'm creating an Access form with 150 items subdivided into 20 categories. Multiple categories (and items) can be selected so my user wants checkboxes. All of the options...
4
by: Kevin Myers | last post by:
Hello, Please forgive my reposting of this note with hopefully a more relevant subject line. On an Access 2000 form under Windows 2000 I would like to use a Kodak Image Edit Control to...
49
by: Yannick Turgeon | last post by:
Hello, We are in the process of examining our current main application. We have to do some major changes and, in the process, are questionning/validating the use of MS Access as front-end. The...
29
by: Patrick | last post by:
I have the following code, which regardless which works fine and logs to the EventViewer regardless of whether <processModel/> section of machine.config is set to username="SYSTEM" or "machine" ...
4
by: Daylor | last post by:
hi. i have multi thread application in vb.net is there a way NET support, so i can mark the class , to be access only for 1 thread each time ? if there is , small sytax sample will help ...
2
by: bobc | last post by:
Any help appreciated with this problem -- I have a Microsoft Access 2002 application. The Access mdb has a refence to DAO 3.6 (not ADO). A form is bound to a linked table in a second mdb. In the...
3
by: Peted | last post by:
Hi i hope i explaine this correctly I have a class with a method that reads and writes using blocking sockets to a TCP device. Call it class IPdevice. I can use this method to send commands and...
16
by: Ben Sehara | last post by:
Is there any way I can limit the access to my website? I have a site "A" and I want to allow access to it only from site "B" login user. If someone try to access site "A" directory, I want it...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.