473,626 Members | 3,298 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to use control globally?

Hello all

If I have an app that is a 'WinFormsApp', and on the form I put a ListBox called 'ListBx'; then I add a generic clas
called 'GenClss', how do I add strings to the 'ListBx' from the 'GenClss'

TIA

Ray K

Nov 16 '05 #1
1 1084
Ray,

In order to do this, you will have to pass the reference for the form
that contains the listbox to the GenClass (through a property, method,
field, etc, etc). Once you do that, an instance of GenClass can then access
the listbox (assuming you made it public), and add items to it.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"raykos" <an*******@disc ussions.microso ft.com> wrote in message
news:D8******** *************** ***********@mic rosoft.com...
Hello all,

If I have an app that is a 'WinFormsApp', and on the form I put a ListBox called 'ListBx'; then I add a generic class called 'GenClss', how do I add strings to the 'ListBx' from the 'GenClss'?

TIA,

Ray K.

Nov 16 '05 #2

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

Similar topics

21
3379
by: steve | last post by:
Dont’ make my mistake. It is costly. Say you have defined a variable $var in your main script. Now in a function you access it using: global $var; But you want to set it to null inside the function. DO: $var = null; DONT DO: unset($var);
13
1702
by: Jean-François Doyon | last post by:
Hello, I'm using MetaClasses to create classes. How do I make these new classes "globally" available? I probably just have to assign them to something magic, but I can't seem to figure out which one. if I do:
4
1884
by: Otto Lind | last post by:
The following program shows the problem: #include <stdio.h> namespace x { enum L { One = 1, Two = 2 }; namespace x { enum L { Three = 3, Four = 4 };
2
2282
by: aevans1108 | last post by:
Greetings Please give me a push in the right direction if this the wrong place to ask this question. Why is it that I can get the count of facets for an element restriction if the corresponding simpleType is declared inline, but I can't get it if the simpleType is globally defined? Given this schema:
1
1988
by: James Glover | last post by:
I need to be able to reference a variable that is set in the code behind of an aspx page in a user control embedded on the page. An example: The code behind sets a position number; say ,1 to 5. The included user control is expecting that variable to know which element to highlight. (The first through tenth LI tag in this example.)
3
2746
by: BradBrigade | last post by:
Hi, I created a control deriving from System.Windows.Forms.Control. In my own OnPaint method, I can draw and set the clipping and everything is perfect. But I also added some checkboxes by setting their parent as my control, and I can seem to get them to clip. They just draw themselves over anything that's under them, right up to the very edge of the control. How do I get them to clip where I want? Do I set a property in my control,...
7
2394
by: Cheryl Langdon | last post by:
Does anyone know if there is a way to globally turn off ALL control tips in Access 2003 using VBA code? Thanks. --- CL
3
2487
by: Carlos Lozano | last post by:
Hello, I am having a problem getting the selectedValue from a dropdownlist that is populated with a dataReader and just can't see the problem. I did the following: dim dr as DataReader dr = DataReader(sSQLcmd) Me.DropDownList1.DataSource = dr
2
1824
by: Marcus | last post by:
Good evening, I'm new to developing large subversion-controlled projects. This one will involve a few third-party libraries like wxWidgets, and perhaps Twisted. Ordinarily you could just install these into your system and they'll end up globally (in Python's Lib/site-packages directory). Is it proper practice to instead install the libraries into a separate of the repository and reference that instead? I've read about vendor branches,...
2
1884
by: Sebastian Paul | last post by:
Hi, I have a user control (EventStructureSelector) used in another user control (ResultsMenu). The class EventStructureSelector defines a public type (ModeType), that is used for one of its properties (Mode). The class ResultsMenu sets the property of the nested control during the PageLoad event. No big thing for now.
0
8711
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
8642
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...
0
8512
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...
0
7203
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4094
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
4206
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2630
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 we have to send another system
1
1815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1515
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.