Mobile Phone Interface: counter W/cmdbutton problem.
Hi everyone. Some of you might have read my question about command buttons acting like number buttons on a mobile phone during text message writing.
This was partly resolved here, but now there is a more fun problem!
It works brilliant, I can press button 2 and get a, b, c or 2. The problem now is that because my mobile phone interface's number buttons are all one in the same *lack techy terms*, all of the numbers do the same thing! lol.
Code:
Private Sub cmdnumber_Click(Index As Integer)
'appearances
Image1.Visible = False
Dim x As Integer
lblnumber.Caption = lblnumber.Caption & Index
For x = 0 To 5
lblmessage.Caption = msg(x)
Next x
If lbltextscreen.Visible = True Then
Static click As Integer
Dim abc As String
click = click + 1
Select Case click
Case 1
abc = "A"
Case 2
abc = "B"
Case 3
abc = "C"
Case 4
abc = "2"
Case Is > 3
click = 0
End Select
lbltextscreen.Caption = abc
End If
End Sub
Re: Mobile Phone Interface: counter W/cmdbutton problem.
I'm just guessing what you're saying. Sometimes translating a post is more of a challenge than the code. :confused: Is this what you're asking?
Code:
Dim abc As String
click = click + 1
Select Case click
Case 1
abc = "A"
' do something here
Case 2
abc = "B"
' do something else here
Case 3
abc = "C"
' do something else here
Case 4
abc = "2"
' do something else here
Case Is > 3
click = 0
' do something else here
End Select
lbltextscreen.Caption = abc
End If
Re: Mobile Phone Interface: counter W/cmdbutton problem.
Hey. I've actually figured it out anyways but have another question. Here's the resolve of my last question.
Code:
Select Case click
Case 1
If Index = 1 Then
abc = "," & abc
ElseIf Index = 2 Then
abc = "A"
ElseIf Index = 3 Then
abc = "D"
ElseIf Index = 4 Then
abc = "G"
ElseIf Index = 5 Then
abc = "J"
ElseIf Index = 6 Then
abc = "M"
ElseIf Index = 7 Then
abc = "P"
ElseIf Index = 8 Then
abc = "T"
ElseIf Index = 9 Then
abc = "W"
End If
Case 2
If Index = 1 Then
abc = "." & abc
ElseIf Index = 2 Then
abc = "B"
ElseIf Index = 3 Then
abc = "E"
ElseIf Index = 4 Then
abc = "H"
ElseIf Index = 5 Then
abc = "K"
ElseIf Index = 6 Then
abc = "N"
ElseIf Index = 7 Then
abc = "Q"
ElseIf Index = 8 Then
abc = "U"
ElseIf Index = 9 Then
abc = "X"
End If
Question1.-
Jimbo Bob is trying to use the code above to program a mobile phone form. This looks exactly like a mobile phone with the background but the screen and the windows that appear on the screen are labels and text boxes. The numbers on the mobile phone are command buttons which are all united under
vb Code:
Private Sub cmdnumber_Click(Index As Integer)
. Using the code above, Jimbo Bob has programmed the mobile phone to act as a word-processor for writing text messages. Please solve the following problem:
Jimbo Bob: "When I press '2' twice, I get the letter b. This is good. But when I press 2 again to get A to come after B, it simply changes the letter B to the letter A - similarly, if after B I press the '3' key, the letter D replaces it . How do I use a timer to fix this problem?
lol nice fun exam type question!
Re: Mobile Phone Interface: counter W/cmdbutton problem.
Quote:
Originally Posted by
Bifrost
Jimbo Bob: "When I press '2' twice, I get the letter b. This is good. But when I press 2 again to get A to come after B, it simply changes the letter B to the letter A - similarly, if after B I press the '3' key, the letter D replaces it . How do I use a timer to fix this problem?
lol nice fun exam type question!
As you say this is an exam type question. Fact is, it is your exam. So try some ideas out and if they don't work then post your code and ask for help.
Your First Post