我现在要建一个主窗体跟几个窗体控件,窗体上有几个按钮,当点击按钮时主窗体的某个区域会显示对应的窗体控件!窗体控件是自己建的用户控件。希望哪位大谢谢侠帮忙写下!

解决方案 »

  1.   

    写自定义控件时候加上Visible属性 就可以了 点击按钮  设置相应控件的Visible 属性
      

  2.   

    Control ctl = new Control();
    ctl.Location=new Point(.,.);
    ctl.Name="";
    this.Controls.Add(ctl);
      

  3.   

    point后门的括号里填什么,name后面怎么填
      

  4.   

    Control ctl = new Control();//new一个对象
    ctl.Location=new Point(.,.);//指定位置
    ctl.Name="";//指定名字
    this.Controls.Add(ctl);//添加这个对象
      

  5.   


                TextBox txt = new TextBox();
                txt.Name = "myText";
                txt.Location = new Point(10, 10);
                txt.KeyPress+=new KeyPressEventHandler(txt_KeyPress);
                this.Controls.Add(txt);
      

  6.   

    point是点,要写坐标位置的就是X,Y
    名字后面是字符串
    this.Controls.Add(ctl);这个是把你刚new的对象添加到这个Controls容器里面
      

  7.   

    point 后面填路径出错,提示不能将string类型转换成point类型!假如调用的控件位置在C:/simple文件夹下怎么写