📄 form1.vb
字号:
Option Strict On
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents Button4 As System.Windows.Forms.Button
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents CheckBox1 As System.Windows.Forms.CheckBox
Friend WithEvents CheckBox2 As System.Windows.Forms.CheckBox
Friend WithEvents CheckBox3 As System.Windows.Forms.CheckBox
Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
Friend WithEvents CheckedListBox1 As System.Windows.Forms.CheckedListBox
Friend WithEvents HScrollBar1 As System.Windows.Forms.HScrollBar
'Required by the Windows Form Designer
Private components As System.ComponentModel.Container
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Button2 = New System.Windows.Forms.Button()
Me.Button3 = New System.Windows.Forms.Button()
Me.TextBox1 = New System.Windows.Forms.TextBox()
Me.CheckBox1 = New System.Windows.Forms.CheckBox()
Me.CheckBox3 = New System.Windows.Forms.CheckBox()
Me.CheckBox2 = New System.Windows.Forms.CheckBox()
Me.Button4 = New System.Windows.Forms.Button()
Me.TextBox2 = New System.Windows.Forms.TextBox()
Me.Button1 = New System.Windows.Forms.Button()
Me.CheckedListBox1 = New System.Windows.Forms.CheckedListBox()
Me.HScrollBar1 = New System.Windows.Forms.HScrollBar()
Me.SuspendLayout()
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(8, 232)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(120, 32)
Me.Button2.TabIndex = 1
Me.Button2.Text = "Button2"
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(136, 232)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(120, 32)
Me.Button3.TabIndex = 1
Me.Button3.Text = "Button3"
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(192, 72)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(168, 20)
Me.TextBox1.TabIndex = 2
Me.TextBox1.Text = "TextBox1"
'
'CheckBox1
'
Me.CheckBox1.Location = New System.Drawing.Point(24, 72)
Me.CheckBox1.Name = "CheckBox1"
Me.CheckBox1.TabIndex = 3
Me.CheckBox1.Text = "CheckBox1"
'
'CheckBox3
'
Me.CheckBox3.Location = New System.Drawing.Point(24, 120)
Me.CheckBox3.Name = "CheckBox3"
Me.CheckBox3.TabIndex = 5
Me.CheckBox3.Text = "CheckBox3"
'
'CheckBox2
'
Me.CheckBox2.Location = New System.Drawing.Point(24, 96)
Me.CheckBox2.Name = "CheckBox2"
Me.CheckBox2.TabIndex = 4
Me.CheckBox2.Text = "CheckBox2"
'
'Button4
'
Me.Button4.Location = New System.Drawing.Point(264, 232)
Me.Button4.Name = "Button4"
Me.Button4.Size = New System.Drawing.Size(120, 32)
Me.Button4.TabIndex = 1
Me.Button4.Text = "Button4"
'
'TextBox2
'
Me.TextBox2.Location = New System.Drawing.Point(192, 104)
Me.TextBox2.Name = "TextBox2"
Me.TextBox2.Size = New System.Drawing.Size(168, 20)
Me.TextBox2.TabIndex = 6
Me.TextBox2.Text = "TextBox2"
'
'Button1
'
Me.Button1.Font = New System.Drawing.Font("Verdana", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(161, Byte))
Me.Button1.Location = New System.Drawing.Point(8, 16)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(376, 40)
Me.Button1.TabIndex = 0
Me.Button1.Text = "Scan Controls on this Form"
'
'CheckedListBox1
'
Me.CheckedListBox1.Location = New System.Drawing.Point(192, 136)
Me.CheckedListBox1.Name = "CheckedListBox1"
Me.CheckedListBox1.Size = New System.Drawing.Size(168, 49)
Me.CheckedListBox1.TabIndex = 7
'
'HScrollBar1
'
Me.HScrollBar1.Location = New System.Drawing.Point(8, 200)
Me.HScrollBar1.Name = "HScrollBar1"
Me.HScrollBar1.Size = New System.Drawing.Size(368, 16)
Me.HScrollBar1.TabIndex = 8
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(392, 273)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.HScrollBar1, Me.CheckedListBox1, Me.TextBox2, Me.CheckBox3, Me.CheckBox2, Me.CheckBox1, Me.TextBox1, Me.Button4, Me.Button3, Me.Button2, Me.Button1})
Me.Name = "Form1"
Me.Text = "Show Controls Demo"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i As Integer
For i = 0 To Me.Controls.Count - 1
Console.WriteLine(Me.Controls(i).ToString)
If Me.Controls(i).GetType Is GetType(System.Windows.Forms.Panel) Then
Dim j As Integer
For j = 0 To Me.Controls(i).Controls.Count - 1
Console.WriteLine(Me.Controls(i).Controls(j).ToString)
Next
End If
Next
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -