473,895 Members | 2,739 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Accessing forms controls in module

Hi all,

If I remember correctly, in VB you can refer to your controls from a module
simply by referring to ControlContaine r, 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
Nov 20 '05 #1
2 1161
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.fntMyFun ction etc

Hope this helps, Pieter

"Phil" <Ph**@nospam.co m> wrote in message
news:c1******** **@sparta.btint ernet.com...
Hi all,

If I remember correctly, in VB you can refer to your controls from a module simply by referring to ControlContaine r, 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

Nov 20 '05 #2
Well hell........... .......thanks! That's simple and I feel dumb I didn't
know :-)

Have a good one!

Rgds, Phil

"DraguVaso" <pi**********@h otmail.com> wrote in message
news:uX******** ******@TK2MSFTN GP11.phx.gbl...
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.fntMyFun ction etc

Hope this helps, Pieter

"Phil" <Ph**@nospam.co m> wrote in message
news:c1******** **@sparta.btint ernet.com...
Hi all,

If I remember correctly, in VB you can refer to your controls from a

module
simply by referring to ControlContaine r, 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


Nov 20 '05 #3

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

Similar topics

2
352
by: Dave PNNZ | last post by:
Can someone help! I want to insert a feild on a Access 2000 database form where you insert Date of Birth in another feild I want in to automaticly caculate how old the person is in years can someone tell me how to do this. cheers Dave
4
12112
by: Jim Heavey | last post by:
Hello, I have created a form which I intend to use a a dialog box. It has a few controls on that form and I changed the properties of those controls to "public" with the idea that I could access those controls from the "calling form", but I am unable to access/see those controls. Why? Here are portions of my code Here I am substantiating the new form and trying to set values for the controls on that form...
5
1951
by: RSH | last post by:
I havent been able to set a property from another class with out getting some sort of error. Can someone please tell me what I'm doing wrong here? Public Class Form1
7
1927
by: Sudhakara.T.P. | last post by:
Hi, I have an tab control in one of the forms and it has two tab strips. Now I have written an general function that accepts form name as parameter and iterates through all the controls in the form and re-initialises that. Now in this context, i have around 15 controls on one of the tab strips page 1 and 5 controls in tab strip 2. now when i iterate through the controls, i am getting the control collection as 3 as there are two more...
9
1265
by: Bob | last post by:
Hello: I have a form with 26 panels. Each panel has a bunch of other controls in it. The panels visible property are set to False. Each panel has a corosponding button to set it's visible property to true and all the other panels to false when clicked. Well, thats a lot of code in the form. I would like to move the code for the buttons to a module for code organization.
4
3645
by: raj_genius | last post by:
I hav two queries, whc are as follows: FIRSTLY: is it possible to access the controls(by name) of a parent form(MDI) from its child forms??if yes then how??plzz provide a coded example in VB if possible.. for example..i hav a menu in the parent form named "Administrator" whic has an item "mnuLogIn"..now when i click on login..another child form named "frmLogIn" is displayed..what i want to happen is this: when login form(frmLogIn) is...
3
10529
by: judy.j.miller | last post by:
Does anyone know why i can't access a form element value using dot notation in firefox, when i'm in a function. Works ok in the body. I'm trying to do this: var FarTemp = faren.temp.value; I can get at the value using the array method, the getelements by id method, and the bracket-with-the-element-name in it method. But the dot notation doesn't work, in firefox, in the function (which i have in the head).
8
2185
by: colmkav | last post by:
Hi, could someone tell me how I can check whether a database is open by name eg something like db("mydbname")
1
1904
by: Grega | last post by:
Hi all, I am trying to create a VB smart device application. I create few buttons dynamically on form_load... something like this: Dim WithEvents BtnOperate As New OpenNETCF.Windows.Forms.Button2 Me.BtnOperate.Location = New System.Drawing.Point(20, 20) Me.BtnOperate.Size = New System.Drawing.Size(150, 150) Me.BtnOperate.TabIndex = 0 Me.Controls.Add(Me.BtnOperate)
0
9990
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11250
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10847
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10938
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
10475
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8030
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5866
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6072
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4291
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.