adding control

  • Thread starter Thread starter Jeroen Ceuppens
  • Start date Start date
J

Jeroen Ceuppens

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
 
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
 
Back
Top