PC Review


Reply
Thread Tools Rate Thread

Accessing forms controls in module

 
 
Phil
Guest
Posts: n/a
 
      29th Feb 2004
Hi all,

If I remember correctly, in VB you can refer to your controls from a module
simply by referring to ControlContainer, ie. Form1.Textbox1.Text =
"something".

I have added a module to my project in .Net and I cannot access any of my
controls in Form1. In fact referring to Form1 brings up a very limited list
of properties. How do I get at my controls and properties?

Thanks,

Phil


 
Reply With Quote
 
 
 
 
DraguVaso
Guest
Posts: n/a
 
      1st Mar 2004
Declare your form in your module, that's the only solution I know.
So in your module you type somewhere:
dim MyForm as new frmMyForm

and than you can in the module refer to all the methods ans properties by
using MyForm.fntMyFunction etc

Hope this helps, Pieter

"Phil" <(E-Mail Removed)> wrote in message
news:c1trk1$31f$(E-Mail Removed)...
> Hi all,
>
> If I remember correctly, in VB you can refer to your controls from a

module
> simply by referring to ControlContainer, ie. Form1.Textbox1.Text =
> "something".
>
> I have added a module to my project in .Net and I cannot access any of my
> controls in Form1. In fact referring to Form1 brings up a very limited

list
> of properties. How do I get at my controls and properties?
>
> Thanks,
>
> Phil
>
>



 
Reply With Quote
 
Phil
Guest
Posts: n/a
 
      1st Mar 2004
Well hell..................thanks! That's simple and I feel dumb I didn't
know :-)

Have a good one!

Rgds, Phil

"DraguVaso" <(E-Mail Removed)> wrote in message
news:uXPhBh6$(E-Mail Removed)...
> Declare your form in your module, that's the only solution I know.
> So in your module you type somewhere:
> dim MyForm as new frmMyForm
>
> and than you can in the module refer to all the methods ans properties by
> using MyForm.fntMyFunction etc
>
> Hope this helps, Pieter
>
> "Phil" <(E-Mail Removed)> wrote in message
> news:c1trk1$31f$(E-Mail Removed)...
> > Hi all,
> >
> > If I remember correctly, in VB you can refer to your controls from a

> module
> > simply by referring to ControlContainer, ie. Form1.Textbox1.Text =
> > "something".
> >
> > I have added a module to my project in .Net and I cannot access any of

my
> > controls in Form1. In fact referring to Form1 brings up a very limited

> list
> > of properties. How do I get at my controls and properties?
> >
> > Thanks,
> >
> > Phil
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Class Module returning ADODB recordset that can be assigned to forms or controls. Arookie Microsoft Access Form Coding 4 16th Apr 2009 06:02 PM
Accessing Controls on Other Forms Mani Microsoft VB .NET 4 3rd Jan 2007 12:42 PM
Accessing Controls on open forms Miguel Cordeiro Microsoft Dot NET Compact Framework 2 1st Jun 2004 05:45 PM
Accessing Web Forms Controls with javascript Red Microsoft ASP .NET 2 25th Apr 2004 02:22 PM
Accessing another forms controls Tim Fitzgerald Microsoft VB .NET 3 31st Jan 2004 01:08 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:24 PM.