📄 input.frm
字号:
VERSION 5.00
Begin VB.Form frmInput
BorderStyle = 3 'Fixed Dialog
Caption = "Yatzy"
ClientHeight = 1575
ClientLeft = 45
ClientTop = 330
ClientWidth = 2190
ClipControls = 0 'False
ControlBox = 0 'False
Icon = "Input.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1575
ScaleWidth = 2190
ShowInTaskbar = 0 'False
StartUpPosition = 1 'CenterOwner
Begin VB.ComboBox cmbInput
Height = 315
ItemData = "Input.frx":000C
Left = 120
List = "Input.frx":000E
Style = 2 'Dropdown List
TabIndex = 4
Top = 600
Width = 975
End
Begin VB.CommandButton cmdCancel
Caption = "Avbryt"
Height = 375
Left = 120
TabIndex = 3
Top = 1080
Width = 855
End
Begin VB.CommandButton cmdOk
Caption = "OK"
Height = 375
Left = 1200
TabIndex = 2
Top = 1080
Width = 855
End
Begin VB.TextBox txtInput
Height = 315
Left = 120
TabIndex = 0
Top = 600
Width = 975
End
Begin VB.Label lblInput
Caption = "lblInput"
Height = 255
Left = 120
TabIndex = 1
Top = 240
Width = 2055
End
End
Attribute VB_Name = "frmInput"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private m_bCancel As Boolean
Const TEXT_NR_PLAYERS As String = "Hur m錸ga spelare?"
Const TEXT_NAME_PLAYERS As String = "Ange initialer f鰎 spelare "
Private Sub Form_Load()
Dim i%
For i = 1 To 5
cmbInput.AddItem i
Next
cmbInput.ListIndex = 1
End Sub
Public Function ShowInputForm(frmOwner As Form, Optional iPlayer As Integer) As String
If iPlayer = 0 Then
txtInput.Visible = False
cmbInput.Visible = True
lblInput = TEXT_NR_PLAYERS
Me.Show vbModal, frmOwner
ShowInputForm = cmbInput.Text
Else
txtInput.Visible = True
cmbInput.Visible = False
lblInput = TEXT_NAME_PLAYERS & iPlayer
txtInput = "P" & iPlayer
Me.Show vbModal, frmOwner
ShowInputForm = Left(UCase(LTrim(txtInput)), 2)
End If
If m_bCancel Then ShowInputForm = "-1"
End Function
Private Sub cmdCancel_Click()
Unload Me
m_bCancel = True
If frmYatzy.mbGameNotStarted Then End
End Sub
Private Sub cmdOK_Click()
m_bCancel = False
Me.Hide
End Sub
Private Sub Form_Paint()
On Error Resume Next
cmbInput.SetFocus
txtInput.SetFocus
End Sub
Private Sub txtInput_GotFocus()
txtInput.SelStart = 0
txtInput.SelLength = Len(txtInput.Text)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -