VB School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a VB Expert!

Join 307,006 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,990 people online right now. Registration is fast and FREE... Join Now!




Help with programming?

 

Help with programming?

327005646

3 Nov, 2009 - 12:45 PM
Post #1

New D.I.C Head
*

Joined: 12 Sep, 2009
Posts: 12

I want to create a program where there's five random letters and the user has to type them. As the user type each letter, the corresponding letter will disappear, and if the user delete a letter, the letter will reappear. For example, if the user typed K, then K will disappear and if the user delete K, then K will reappear.

I did the disappearing part and it works, but I'm having a bit trouble with the reappearing part. Can anyone help me?


CODE


Private Sub txtEnter_change()
    strInput = LCase(txtEnter.Text)      'reads user's input
    strU_Letter = Right(strInput, 1)      

    If strU_Letter = strLetter_1 Then
        strLetter_1 = " "
        lblLetter_1.Caption = ""
    ElseIf strU_Letter = strLetter_2 Then
        lblLetter_2.Caption = ""
        strLetter_2 = " "
    ElseIf strU_Letter = strLetter_3 Then
        lblLetter_3.Caption = ""
        strLetter_3 = " "
    ElseIf strU_Letter = strLetter_4 Then
        lblLetter_4.Caption = ""
        strLetter_4 = " "
    ElseIf strU_Letter = strLetter_5 Then
        strLetter_5 = " "
        lblLetter_5.Caption = ""
    End If

end sub



User is offlineProfile CardPM
+Quote Post


bytelogik

RE: Help With Programming?

4 Nov, 2009 - 02:04 AM
Post #2

D.I.C Head
**

Joined: 6 Oct, 2009
Posts: 63



Thanked: 5 times
My Contributions
please explain a little bit more.

1) 5 random letters A,D,F,X,J
2) If the user enters D, the D from the above string disappears.
2.a) The string now becomes A, ,F,X,J

3) If the user deletes D, the D in the above string appears.
3.a) The string now becomes A,D,F,X,J

Does the user know the 5 random letters ?
Do you have a command button to delete a particular letter ?

User is offlineProfile CardPM
+Quote Post

theunborncoder

RE: Help With Programming?

4 Nov, 2009 - 02:19 AM
Post #3

D.I.C Head
Group Icon

Joined: 15 Oct, 2009
Posts: 54



Thanked: 6 times
Dream Kudos: 50
My Contributions
'I want to create a program where there's five random letters and the user 'has to type them. As the user type each letter, the corresponding letter 'will disappear, and if the user delete a letter, the letter will reappear.

How come user delete any letter u have any GUI for that??
User is offlineProfile CardPM
+Quote Post

bytelogik

RE: Help With Programming?

4 Nov, 2009 - 05:54 AM
Post #4

D.I.C Head
**

Joined: 6 Oct, 2009
Posts: 63



Thanked: 5 times
My Contributions
"How come user delete any letter u have any GUI for that?? "

I think you don't need any GUI for this. But you will have to write code implementing some string manipulation.
Attach a screenshot of your form to help me to solve your problem better.

Obviously there are 2 things:
1) The user types the letter
2) The program makes the letter appear/disappear the letter from the random letters if it is present.

a) You have written the code for disappear issue.
cool.gif If the random letter string is constant, it is possible to check the letter the user has typed. Simultaneously you will have to keep two strings in the memory. One is your original 5 letter string, and the another which is modified by the program by appearing/disappearing the letter in the string.

Is this what you want ?
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 06:58AM

Live VB Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month