📄 form1.vb
字号:
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
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'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.
Friend WithEvents card1 As BetterCard.Card
Friend WithEvents suitList As System.Windows.Forms.ListBox
Friend WithEvents faceValueList As System.Windows.Forms.ListBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.card1 = New BetterCard.Card()
Me.suitList = New System.Windows.Forms.ListBox()
Me.faceValueList = New System.Windows.Forms.ListBox()
Me.SuspendLayout()
'
'card1
'
Me.card1.BackColor = System.Drawing.Color.White
Me.card1.FaceUp = True
Me.card1.FaceValue = BetterCard.FaceValue.Ace
Me.card1.Location = New System.Drawing.Point(16, 24)
Me.card1.Name = "card1"
Me.card1.Size = New System.Drawing.Size(60, 75)
Me.card1.Suit = BetterCard.Suit.Hearts
Me.card1.TabIndex = 0
'
'suitList
'
Me.suitList.Location = New System.Drawing.Point(120, 24)
Me.suitList.Name = "suitList"
Me.suitList.Size = New System.Drawing.Size(120, 95)
Me.suitList.TabIndex = 1
'
'faceValueList
'
Me.faceValueList.Location = New System.Drawing.Point(120, 144)
Me.faceValueList.Name = "faceValueList"
Me.faceValueList.Size = New System.Drawing.Size(120, 95)
Me.faceValueList.TabIndex = 2
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(292, 266)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.faceValueList, Me.suitList, Me.card1})
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
suitList.DataSource = _
System.Enum.GetValues(System.Type.GetType("BetterCard.Suit"))
faceValueList.DataSource = _
System.Enum.GetValues(FaceValue.Queen.GetType())
End Sub
Private Sub suitList_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles suitList.SelectedIndexChanged
Me.card1.Suit = CType(Me.suitList.SelectedItem, Suit)
End Sub
Private Sub faceValueList_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles faceValueList.SelectedIndexChanged
Me.card1.FaceValue = CType(Me.faceValueList.SelectedItem, FaceValue)
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -