6.以下那段代码可以定义一个控件使得该控件包含一个TextBox和Button 选项: A:Public class MyControl: UserControl{
public MyControl(){
TextBox textBox1=new TextBox();
Button button1=new Button();
button1.Top=textBox1.Height;
this.Controls.Add(textBox1);
this.Controls.Add(button1);
}}
B:Public class MyControl: UserControl{
TextBox textBox1=new TextBox();
Button button1=new Button();
button1.Top=textBox1.Height;
this.Controls.Add(textBox1);
this.Controls.Add(button1);
}
C:Public class MyControl: TextBox,Button{
public MyControl(){
TextBox textBox1=new TextBox();
Button button1=new Button();
button1.Top=textBox1.Height;
this.Controls.Add(textBox1);
this.Controls.Add(button1);
}}
D:Public class MyControl: TextBox,Button{
TextBox textBox1=new TextBox();
Button button1=new Button();
button1.Top=textBox1.Height;
this.Controls.Add(textBox1);
this.Controls.Add(button1);
}