adding control

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jeroen Ceuppens

    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.Locatio n = new System.Drawing. Point(300, 300);


    this.Controls.A dd(panelke);

    panelke.Visible =true;



    (some code from the OptiePanel class)

    this.Controls.A dd(labelHoofd);

    this.Controls.A dd(labelHoofd);

    this.Controls.A dd(labelH);

    this.Controls.A dd(labelV);

    this.Controls.A dd(button);

    this.Controls.A dd(textBoxH);

    this.Controls.A dd(textBoxV);



    Greetz

    JC






  • Vijaye Raji

    #2
    Re: adding control

    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" <jeroen.ceuppen s@barco.com> wrote in message
    news:u%23cpvYPu DHA.2492@TK2MSF TNGP12.phx.gbl. ..[color=blue]
    > 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[/color]
    the[color=blue]
    > panelke and its buttons, labels :-( What should I change about this code?
    >
    > (some code from the Form1 class)
    >
    > OptiePanel panelke=new OptiePanel();
    >
    > panelke.Locatio n = new System.Drawing. Point(300, 300);
    >
    >
    > this.Controls.A dd(panelke);
    >
    > panelke.Visible =true;
    >
    >
    >
    > (some code from the OptiePanel class)
    >
    > this.Controls.A dd(labelHoofd);
    >
    > this.Controls.A dd(labelHoofd);
    >
    > this.Controls.A dd(labelH);
    >
    > this.Controls.A dd(labelV);
    >
    > this.Controls.A dd(button);
    >
    > this.Controls.A dd(textBoxH);
    >
    > this.Controls.A dd(textBoxV);
    >
    >
    >
    > Greetz
    >
    > JC
    >
    >
    >
    >
    >
    >[/color]


    Comment

    Working...