473,499 Members | 1,579 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Module Control Addressing in VB.Net

Good evening all,

I am going crazy with a problem that I am sure has a simple solution.

I need to add items to a ComboBox on a Form. I can do it simply when I
code on form.vb, but when go to a procedure on a seperate module it says
"Name 'ComboBox' is not declared". I have tried setting the modifiers
for the ComboBox to Public, Friend and Private all to no avail. I am
also not sure why on the main page "Me." is used before a control, I
tried this on the module but it didn't work.

Any help you may be able to provide would be much appreciated as I am
still trying to learn this language.

Yours sincerely,

Brent McIntyre

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
3 3719
Hello,

"Brent McIntyre" <br************@aep.salvationarmy.org> schrieb:
I am going crazy with a problem that I am sure has a simple
solution.

I need to add items to a ComboBox on a Form. I can
do it simply when I code on form.vb, but when go to
a procedure on a seperate module it says "Name
'ComboBox' is not declared".


You must pass a reference to the control, for example in a parameter:

\\\
Imports System.Windows.Forms

Public Module MyModule
Public Sub Bla(ByVal Foo As ComboBox)
Foo.Items.Add(...)
End Sub
End Module
///

Usage (in the form):

\\\
MyModule.Bla(Me.ComboBox1)
///

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #2
OOP is a bitch sometimes. Herfried is exactly right. You really have
to watch that cause variables are objects aswell.

The only thing I've never figured out is in an MDI environment, how to
reference one child from another LOL

Just remember, everything's an object and all objects have to be
referenced/declared somewhere somehow :)

Tibby
"Brent McIntyre" <br************@aep.salvationarmy.org> wrote in message
news:O3**************@TK2MSFTNGP10.phx.gbl...
Good evening all,

I am going crazy with a problem that I am sure has a simple solution.

I need to add items to a ComboBox on a Form. I can do it simply when I
code on form.vb, but when go to a procedure on a seperate module it says
"Name 'ComboBox' is not declared". I have tried setting the modifiers
for the ComboBox to Public, Friend and Private all to no avail. I am
also not sure why on the main page "Me." is used before a control, I
tried this on the module but it didn't work.

Any help you may be able to provide would be much appreciated as I am
still trying to learn this language.

Yours sincerely,

Brent McIntyre

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #3
"Brent McIntyre" <br************@aep.salvationarmy.org> schrieb
I am going crazy with a problem that I am sure has a simple
solution.

I need to add items to a ComboBox on a Form. I can do it simply when
I code on form.vb, but when go to a procedure on a seperate module it
says "Name 'ComboBox' is not declared". I have tried setting the
modifiers for the ComboBox to Public, Friend and Private all to no
avail. I am also not sure why on the main page "Me." is used before
a control, I tried this on the module but it didn't work.

Any help you may be able to provide would be much appreciated as I
am still trying to learn this language.


The Combobox is a property of the Form. If you want to access a property of
an object, you need a reference to the object. If you don't have a reference
you have to pass it to the Module.
--
Armin

Nov 20 '05 #4

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

Similar topics

2
1835
by: Kenneth McDonald | last post by:
I'd like to propose a new PEP , for a standard library module that deals with files and file paths in an object oriented manner. I believe this module should be included as part of the standard...
22
3297
by: Luke | last post by:
Elements with name attribute: form, input, textarea, a, frame, iframe, button, select, map, meta, applet, object, param, img (if you know more reply...) Methods of addresing html elements:...
11
2449
by: Tony Williams | last post by:
I have a module called GetDocIndex which calculates a sequential number in a control called CommDocNbrtxt. On the BeforeUpdate property of the form I have the following code Private Sub...
1
1985
by: S. van Beek | last post by:
Dear reader, In case an application is ussing an external model library you have to address this external model library in your application. This addressing takes place in a module of the...
6
15138
by: Valerie Hough | last post by:
I'm not entirely sure what the difference is between these two approaches. In order to avoid reentrant code, I was using Control.BeginInvoke in my UI to cause an asynchronous activity to be done...
0
2020
by: Stefan Lischke | last post by:
Hi, I'm really desperate using code generation(wsdl.exe) from wsdl files for latest WS-Eventing(including WS-Addressing) Specs. I'm writing my diploma about "publish subscribe systems based on...
0
1310
by: gerritmitchell | last post by:
Hi, I have a situation where I need to send a SOAP message from a receiver through multiple intermediaries and then to an ultimate receiver. The intial sender will tell the intermediary where...
1
4077
by: =?Utf-8?B?dWx0cmFuZXQ=?= | last post by:
We have a client that uses .Net that needs to work against our Java (xfire) based WS. My question is: how can a .Net (C#) WS client be configured to not send WS-Addressing headers? The client in...
0
7130
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
7171
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,...
0
7220
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...
1
4918
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...
0
4599
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
3098
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
3090
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
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 ...
0
295
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.