📄 form1.vb
字号:
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows 窗体设计器生成的代码 "
Public Sub New()
MyBase.New()
'该调用是 Windows 窗体设计器所必需的。
InitializeComponent()
'在 InitializeComponent() 调用之后添加任何初始化
End Sub
'窗体重写 dispose 以清理组件列表。
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
'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer
'注意: 以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器修改此过程。
'不要使用代码编辑器修改它。
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents tb2 As System.Windows.Forms.TextBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Label2 = New System.Windows.Forms.Label
Me.tb2 = New System.Windows.Forms.TextBox
Me.Button1 = New System.Windows.Forms.Button
Me.SuspendLayout()
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(8, 16)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(120, 32)
Me.Label2.TabIndex = 2
Me.Label2.Text = "你输入过的数字为:"
'
'tb2
'
Me.tb2.Location = New System.Drawing.Point(16, 96)
Me.tb2.Name = "tb2"
Me.tb2.ReadOnly = True
Me.tb2.Size = New System.Drawing.Size(264, 21)
Me.tb2.TabIndex = 3
Me.tb2.Text = ""
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(88, 176)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(112, 32)
Me.Button1.TabIndex = 4
Me.Button1.Text = "请点击输入"
'
'Form1
'
Me.AcceptButton = Me.Button1
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(292, 266)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.tb2)
Me.Controls.Add(Me.Label2)
Me.Name = "Form1"
Me.Text = "Form1"
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 size(19) As Integer
Dim number(19) As Integer
Dim i, j, s, k As Integer
Dim output As String = ""
Dim b As String = ""
For i = 0 To 19
size(i) = CInt(InputBox("请输入10到100"))
If (size(i) < 10 Or size(i) > 100) Then
MessageBox.Show("请输入10到100以内的数")
k = 2
End If
c(i) = size(i)
For j = 0 To (i - 1)
If number(i) = number(j) Then
s = 1
End If
Next
If (s <> 1 And k <> 2) Then
output += number(i).ToString + " "
Else
output += ""
s = 0
k = 0
End If
tb2.Text = output
Next
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -