473,385 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

adding control

I want to add an object of these class:

public class OptiePanel : System.Windows.Forms.Control

When I add an object called panelke (in the Form1 class), it doesn't add the
panelke and its buttons, labels :-( What should I change about this code?

(some code from the Form1 class)

OptiePanel panelke=new OptiePanel();

panelke.Location = new System.Drawing.Point(300, 300);
this.Controls.Add(panelke);

panelke.Visible=true;

(some code from the OptiePanel class)

this.Controls.Add(labelHoofd);

this.Controls.Add(labelHoofd);

this.Controls.Add(labelH);

this.Controls.Add(labelV);

this.Controls.Add(button);

this.Controls.Add(textBoxH);

this.Controls.Add(textBoxV);

Greetz

JC


Nov 15 '05 #1
1 1097
I don't see anything wrong in the code snippet you pasted. Perhaps you need
to set the size explicitly???

It might be helpful if you post more of your code...

-vJ

"Jeroen Ceuppens" <je*************@barco.com> wrote in message
news:u%****************@TK2MSFTNGP12.phx.gbl...
I want to add an object of these class:

public class OptiePanel : System.Windows.Forms.Control

When I add an object called panelke (in the Form1 class), it doesn't add the panelke and its buttons, labels :-( What should I change about this code?

(some code from the Form1 class)

OptiePanel panelke=new OptiePanel();

panelke.Location = new System.Drawing.Point(300, 300);
this.Controls.Add(panelke);

panelke.Visible=true;

(some code from the OptiePanel class)

this.Controls.Add(labelHoofd);

this.Controls.Add(labelHoofd);

this.Controls.Add(labelH);

this.Controls.Add(labelV);

this.Controls.Add(button);

this.Controls.Add(textBoxH);

this.Controls.Add(textBoxV);

Greetz

JC


Nov 15 '05 #2

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

Similar topics

7
by: Andy Bates | last post by:
I have hopefully a simple problem in C#. I designed a form with a listview on left, vert splitter against that, then the remainder of the form from top to bottom: a listview, horiz splitter and...
2
by: avivgur | last post by:
Hello, I am writing a program in Visual C# and I have encountered a problem. In my program I want to dynamically create a multitude of controls (thousands) on a form. The problem is that calling...
4
by: DotNetJunky | last post by:
I have built a control that runs an on-line help system. Depending on the category you selected via dropdownlist, it goes out and gets the child subcategories, and if there are any, adds a new...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
5
by: Jeremy Ames | last post by:
I have run into a major road block with my page development projects. I am trying to add a literal control to my asp.net page and I got an error stating that the control could not be added because...
5
by: Web Team | last post by:
Hi All, Can someone please explain how I go about adding a control (Say for example a panel) to a custom web control. I've tried this: Protected Overrides Sub Render(ByVal output As...
4
by: Duncan Dimech | last post by:
Dear All I am writing a tool which requires to have controls added to it dynamically. To make the task more complex, the addition of the control cannot happen anywhere but it has to be instead of...
9
by: Kadett | last post by:
Hi all, I have following problem: I'm creating a ListView (Details) control at run-time and filling it with some records (let's say 10 000). This operation seems to be quite fast, but when I call...
11
by: Pete Kane | last post by:
Hi All, does anyone know how to add TabPages of ones own classes at design time ? ideally when adding a new TabControl it would contain tab pages of my own classes, I know you can achieve this with...
2
by: ChrisCicc | last post by:
Hi All, I got a real doozy here. I have read hundreds upon hundreds of forum posts and found numerous others who have replicated this problem, but have yet to find a solution. Through testing I have...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.