473,563 Members | 2,662 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

adding a component

Hi,
I want to add a component of these class :

public class OptiePanel : System.Componen tModel.Componen t

I put on this class in a constructor with in it lost of things to add like:
this.Container. Add(labelHoofd) ;

So if I want to add an object of this class in the main form, how should I
do it?

Because if I do this it will not work:

OptiePanel panelke=new OptiePanel();

this.Container. Add(panelke); // this is in a window form

My goal is to make a lots of components, so they can be added when the are
needed

THx

JC




Nov 15 '05 #1
2 7436
Jeroen,

Are these meant to have a visual representation? If so, then you might
want to derive from Control instead of deriving from Component. Objects
derived from Component don't necessarily have a visual representation.

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

"Jeroen Ceuppens" <je************ *@barco.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hi,
I want to add a component of these class :

public class OptiePanel : System.Componen tModel.Componen t

I put on this class in a constructor with in it lost of things to add like: this.Container. Add(labelHoofd) ;

So if I want to add an object of this class in the main form, how should I
do it?

Because if I do this it will not work:

OptiePanel panelke=new OptiePanel();

this.Container. Add(panelke); // this is in a window form

My goal is to make a lots of components, so they can be added when the are
needed

THx

JC



Nov 15 '05 #2
Yes, i need visual representation

I think you are right about it, i gonna try that!

Thx!
JC
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> schreef
in bericht news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Jeroen,

Are these meant to have a visual representation? If so, then you might want to derive from Control instead of deriving from Component. Objects
derived from Component don't necessarily have a visual representation.

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

"Jeroen Ceuppens" <je************ *@barco.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hi,
I want to add a component of these class :

public class OptiePanel : System.Componen tModel.Componen t

I put on this class in a constructor with in it lost of things to add

like:
this.Container. Add(labelHoofd) ;

So if I want to add an object of this class in the main form, how should I do it?

Because if I do this it will not work:

OptiePanel panelke=new OptiePanel();

this.Container. Add(panelke); // this is in a window form

My goal is to make a lots of components, so they can be added when the are needed

THx

JC




Nov 15 '05 #3

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

Similar topics

6
467
by: TnCoder | last post by:
Hi; I just moved from vb 6.0 to vb.net. I am trying to add MS Calendar control to my toolbox. After the control is added, it is not enabled. Is there dll I have to add? Can anyone who could give me a step-by-step on how to add this control? All help would be appreciated.
2
6147
by: David Williams | last post by:
I have a simple XML file that I have been using: <component name="test"> <class name="class"/> <component> Up till now, the Xpath of "//component/class" worked well to select the <class> tag. Recently we added a namespace to the <component> tag:
0
1282
by: Alin Comsa | last post by:
Hello, I am trying to add a component in Component Services package from my program and i really don't have any clue how to do it. Have anyone any idea how to do that? Thanx
1
1720
by: Lauchlan M | last post by:
Hi. I followed the steps suggested below . . . Say I created my component in the namespace "cld.aspnet.components" - where (filepath) would I look for the dll to add in to the toolbox, and what would be called? Visual Studio.NET has too many places where this file could be - somewhere in my INETPUB, somewhere in the visual studio...
6
3361
by: cpnet | last post by:
I've authored a custom web component (a non-ui component kinda like a DataSet) and so far it's working. When my web component is added to the web form in the designer from the toolbox, the namespace for my component is automatically added to the using directive of the codebehind. And, the appropriate assembly is added to the "References" for...
4
8241
by: Amin Sobati | last post by:
Hi, I have added a component class that inherits System.windows.Forms.TextBox. This component is in the same project as my windows application (executable). I could instantiate it and add to form's controls collection but I want to know that if it is possible to add it to the toolbox like if this component was in separate project in this...
12
1809
by: cjobes | last post by:
Hi all, I'm trying to create a dataset as a component to make it accessable from all forms. I have used that following code so far in the component designer: Inherits System.ComponentModel.Component Dim _TryDs As dataSet = NewTry Public Property dataSet() As dataSet Get
5
1804
by: Doug | last post by:
I am looking at using the decorator pattern to create a rudimentary stored proc generator but am unsure about something. For each class that identifies a part of the stored proc, what if I want to add a value dynamically. I'm including some code to show what I mean. This is real basic on what I want to do: using System; namespace...
1
1528
by: Doug | last post by:
I am looking at using the decorator pattern to create a rudimentary stored proc generator but am unsure about something. For each class that identifies a part of the stored proc, what if I want to add a value dynamically. I'm including some code to show what I mean. This is real basic on what I want to do: using System; namespace...
0
7659
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...
0
7882
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. ...
0
8103
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...
1
7634
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...
1
5481
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...
0
3634
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...
0
3618
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2079
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
0
916
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...

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.