473,503 Members | 12,367 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Accessing Forms from a Class

I have a form created in the IDE and I want to access a combo bix control on
this from. How do I do it?
--
Cheers
Ithaqua
Nov 21 '05 #1
3 982
"Ithaqua" <It*****@discussions.microsoft.com> schrieb:
I have a form created in the IDE and I want to access a combo bix control
on
this from. How do I do it?


You may want to pass a reference pointing to the form's instance to the
class.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2
Could you show me how to do that?

Cheers
Ithaqua
--
Cheers
Ithaqua
"Herfried K. Wagner [MVP]" wrote:
"Ithaqua" <It*****@discussions.microsoft.com> schrieb:
I have a form created in the IDE and I want to access a combo bix control
on
this from. How do I do it?


You may want to pass a reference pointing to the form's instance to the
class.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3
You may not want to do that. It is technically possible but possibly bad
programming practice to reference your UI elements from your classes.
Instead it is better to have the code in your classes UI independent.
Therefore, I would recommend referencing your class from your UI instead and
calling methods of your class passing information from the form. For example:

'*** In form load event create the class
MyClass = New MyClass
'*** In a button click or some other UI event handler call the method on
'*** the class passing the data from the form.
MyClass.DoSomething(txtTextBox.Text)

"Ithaqua" wrote:
Could you show me how to do that?

Cheers
Ithaqua
--
Cheers
Ithaqua
"Herfried K. Wagner [MVP]" wrote:
"Ithaqua" <It*****@discussions.microsoft.com> schrieb:
I have a form created in the IDE and I want to access a combo bix control
on
this from. How do I do it?


You may want to pass a reference pointing to the form's instance to the
class.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4

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

Similar topics

6
2716
by: Chris Styles | last post by:
Dear All, I've been using some code to verify form data quite happily, but i've recently changed the way my form is structured, and I can't get it to work now. Originally : The form is...
2
6161
by: 0 x deadbeef | last post by:
I have constructed the following form: public class Form1 : System.Windows.Forms.Form { //code here to declare components .... public void GenerateNodes() { FillDirectoryTree(tvwSource,...
2
1690
by: Greg Merideth | last post by:
Using Visual C# I created two forms such as namespace test { public class SystemTray : System.Windows.Forms.Form { public createwindow() { stuff here; } public fadewindow() { stuff to fade...
8
3543
by: Mike Caputo | last post by:
In VB.NET, need to be able to access certain properties on my main form from other forms. These are properties that may be changed by the user, so I have to be able to get to them throughout the...
3
3346
by: Mike N. | last post by:
Using VB.Net and ADO: I've created a public variable on my main form and set it to = a dataset which was crrated with the designer. I have another form with a datagrid on it. In the designer,...
5
1937
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
2
2101
by: Gary Townsend | last post by:
I have seen similar requests to this but not quite what i was looking for i have an mdi interface and i have 3 child forms 2 are application forms (meaning they do stuff for the application) and...
3
2169
by: DotNetNewbie | last post by:
I am reading the book Teach Yourself Microsoft Visual Basic .Net 2003 in 21 Days. I am having trouble getting one of the exercises to work at the end of day 4. Exercises: 1. Create a new...
3
10496
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...
0
2019
by: Roger Stoller | last post by:
Hello. I have developed a COM object using ATL. It seems to work fine when accessing it from VB.NET most of the time. However, I want to use a delegate in VB to asynchronously run a method in...
0
7098
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
7296
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
7364
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...
0
5604
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,...
0
4696
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
3186
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
3174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
751
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
405
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.