Public Partial Class AlphanumericKeyPad
Inherits Form
Private m_MaxDigits As Integer
Private m_sInitValue As String
Private m_sValue As String
Private m_OutState As Boolean
Public Sub New()
InitializeComponent()
m_MaxDigits = 30
m_sValue = ""
m_OutState = False
AlphanumericTextBox.Text = m_sValue + "»"c
End Sub
Public Sub SetValue(ByVal sInitValue As String)
m_sValue = InlineAssignHelper(m_sInitValue, sInitValue)
End Sub
Public Function GetValue() As String
Return m_sInitValue
End Function
Private Sub Insert(ByVal ch As Char)
Dim Str As String
Str = ""
Str += ch
If Not buttonShift.Checked Then
Str = Str.ToLower()
End If
If m_sValue.Length < m_MaxDigits Then
m_sValue += Str
End If
AlphanumericTextBox.Text = m_sValue + "»"c
End Sub
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
Insert("1"c)
End Sub
Private Sub button2_Click(ByVal sender As Object, ByVal e As EventArgs)
Insert("2"c)
End Sub
Private Sub button3_Click(ByVal sender As Object, ByVal e As EventArgs)
Insert("3"c)
End Sub
Private Sub button4_Click(ByVal sender As Object, ByVal e As EventArgs)
Insert("4"c)
End Sub
Private Sub button5_Click(ByVal sender As Object, ByVal e As EventArgs)
Insert("5"c)
End Sub
Private Sub button6_Click(ByVal sender As Object, ByVal e As EventArgs)
Insert("6"c)
End Sub
Private Sub button7_Click(ByVal sender As Object, ByVal e As EventArgs)
Insert("7"c)
End Sub
Private Sub button8_Click(ByVal sender As Object, ByVal e As EventArgs)
Insert("8"c)
End Sub
Private Sub button9_Click(ByVal sender As Object, ByVal e As EventArgs)
Insert("9"c)
End Sub
Private Sub button0_Click(ByVal sender As Object, ByVal e As EventArgs)
Insert("0"c)
End Sub
Private Sub buttonQ_Click(ByVal sender As Object, ByVal e As EventArgs)
Insert("Q"c)
End Sub
Private Sub buttonW_Click(ByVal sender As Object, ByVal e As EventArgs)
Insert("W"c)
End Sub
Private Sub buttonE_Click(ByVal sender As Object, ByVal e As EventArgs)
Insert("E"c)
End Sub
Private Sub buttonR_Click(ByVal sender As Object, ByVal e As EventArgs)
Insert("R"c)
End Sub
Private Sub buttonT_Click(ByVal sender As Object, ByVal e As EventArgs)
Insert("T"c)
End Sub

Rispondi quotando