首页 | 互联网 | IT动态 | IT培训 | Cisco | Windows | Linux | Java | .Net | Oracle | 软件测试 | C/C++ | 嵌入式开发 | 存储世界 | 服务器
网络设备 | IDC | 安全 | 求职招聘 | 数字网校 | 网页设计 | 平面设计 | 技术专题 | 电子书下载 | 教学视频 | 源码下载 | 搜索 | 博客 | 论坛
中国IT实验室Dotnet频道
中国IT教育
Google
首页 ASP.NET  C#  XML/WebService ADO.NET VC.NET VB.NET .NET 资讯动态 专题 RSS订阅 讨论 下载
您现在的位置: 中国IT实验室 >> Dotnet >> VB.NET >> 正文

vb.net入门之分组控件:GroupBox控件

  '把它们添加到父控件Form1的Controls集合中

  Me.Controls.Add(TextBox1)

  Me.Controls.Add(Label1)

  '添加三个GroupBox控件

  Dim GroupBox1 As New System.Windows.Forms.GroupBox

  Dim GroupBox2 As New System.Windows.Forms.GroupBox

  Dim GroupBox3 As New System.Windows.Forms.GroupBox

  'GroupBox1

  GroupBox1.BackColor = System.Drawing.SystemColors.Control

  GroupBox1.Location = New System.Drawing.Point(8, 40)

  GroupBox1.Name = "GroupBox1"

  GroupBox1.Size = New System.Drawing.Size(96, 104)

  GroupBox1.TabIndex = 3

  GroupBox1.TabStop = False

  GroupBox1.Text = "性别"

  'GroupBox2

  GroupBox2.Location = New System.Drawing.Point(103, 40)

  GroupBox2.Name = "GroupBox2"

  GroupBox2.Size = New System.Drawing.Size(96, 104)

  GroupBox2.TabIndex = 4

  GroupBox2.TabStop = False

  GroupBox2.Text = "单元"

  'GroupBox3

  GroupBox3.Location = New System.Drawing.Point(197, 40)

  GroupBox3.Name = "GroupBox3"

  GroupBox3.Size = New System.Drawing.Size(96, 104)

  GroupBox3.TabIndex = 5

  GroupBox3.TabStop = False

  GroupBox3.Text = "楼层"

  '把它们添加到父控件Form1的Controls集合中

  Me.Controls.Add(GroupBox1)

  Me.Controls.Add(GroupBox2)

  Me.Controls.Add(GroupBox3)

  '添加RadioButton控件并分别绘制在GroupBox控件内

  Dim RadioButton1 As New System.Windows.Forms.RadioButton

  Dim RadioButton2 As New System.Windows.Forms.RadioButton

  Dim RadioButton3 As New System.Windows.Forms.RadioButton

  Dim RadioButton5 As New System.Windows.Forms.RadioButton

  Dim RadioButton4 As New System.Windows.Forms.RadioButton

  Dim RadioButton6 As New System.Windows.Forms.RadioButton

  Dim RadioButton7 As New System.Windows.Forms.RadioButton

  Dim RadioButton8 As New System.Windows.Forms.RadioButton

  Dim RadioButton9 As New System.Windows.Forms.RadioButton

  Dim RadioButton10 As New System.Windows.Forms.RadioButton

  'RadioButton1

  RadioButton1.Location = New System.Drawing.Point(8, 24)

  RadioButton1.Name = "RadioButton1"

  RadioButton1.Size = New System.Drawing.Size(80, 24)

  RadioButton1.TabIndex = 0

  RadioButton1.Text = "男性"

  'RadioButton2

  RadioButton2.Location = New System.Drawing.Point(8, 63)

  RadioButton2.Name = "RadioButton2"

  RadioButton2.Size = New System.Drawing.Size(80, 24)

  RadioButton2.TabIndex = 1

  RadioButton2.Text = "女性"

  'RadioButton3

  RadioButton3.Location = New System.Drawing.Point(8, 32)

  RadioButton3.Name = "RadioButton3"

  RadioButton3.Size = New System.Drawing.Size(80, 24)

  RadioButton3.TabIndex = 1

  RadioButton3.Text = "二单元"

  'RadioButton5

  RadioButton5.Location = New System.Drawing.Point(8, 53)

  RadioButton5.Name = "RadioButton5"

  RadioButton5.Size = New System.Drawing.Size(80, 24)

  RadioButton5.TabIndex = 2

  RadioButton5.Text = "三单元"

  'RadioButton4

  RadioButton4.Location = New System.Drawing.Point(8, 13)

  RadioButton4.Name = "RadioButton4"

  RadioButton4.Size = New System.Drawing.Size(80, 24)

  RadioButton4.TabIndex = 0

  RadioButton4.Text = "一单元"

上一页  [1] [2] [3] 下一页

【责编:John】

中国IT教育

相关产品和培训
文章评论
 友情推荐链接
 认证培训
 社区讨论
 博客论点
 Dotnet频道相关导航