Closed Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: How to make a textbox not to show a specified number or letter ?

  1. #1
    Join Date
    Jun 2007
    Location
    Kosovo
    Posts
    660
    Rep Power
    23

    How to make a textbox not to show a specified number or letter ?

    how can i make that a textbox dont show a number or a letter
    when someone tries to tipp 6 there will nothing appear can someone show me that ?

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #2
    Join Date
    Aug 2006
    Posts
    11,209
    Blog Entries
    6
    Rep Power
    101
    well in that case you will have to make that when vbKey6 (or something like that) is pressed text1.text = ""

    or something similar. Sorry but I can't show you the code because VB6.0 is not installed.

  4. #3
    Join Date
    Jun 2007
    Location
    Kosovo
    Posts
    660
    Rep Power
    23
    thanks anyway i thing you mean using if text1.text = "6" then
    text1.text = "" end if
    i thing that should works but i thought there must be an easier way

  5. #4
    Skel is offline Learning Programmer
    Join Date
    May 2007
    Posts
    33
    Rep Power
    0
    Code:
    If text1.text = "6" then
    text1.text = "" 
    End If
    That's the best way to do it..
    Last edited by Skel; 02-23-2008 at 03:11 PM.

  6. #5
    Join Date
    Aug 2006
    Posts
    11,209
    Blog Entries
    6
    Rep Power
    101
    No i did not mean that, i mean you should monitor all buttons pressed and if 6 is pressed while you have a focus on text1 then text1.text=""

    hope you understood better.

  7. #6
    Join Date
    Jun 2007
    Location
    Kosovo
    Posts
    660
    Rep Power
    23
    Quote Originally Posted by TcM View Post
    No i did not mean that, i mean you should monitor all buttons pressed and if 6 is pressed while you have a focus on text1 then text1.text=""

    hope you understood better.
    i never worked with focus before how is an example code ?

  8. #7
    Join Date
    Aug 2006
    Posts
    11,209
    Blog Entries
    6
    Rep Power
    101
    Well I don't have VB 6.0 installed but it's either something like text1.focus or use the procedure text1_onfocus() maybe something like that....

  9. #8
    Join Date
    Jun 2007
    Location
    Kosovo
    Posts
    660
    Rep Power
    23
    i will try it i hope i do it right

  10. #9
    badkarma is offline Newbie
    Join Date
    Feb 2008
    Posts
    7
    Rep Power
    0
    Quote Originally Posted by TcM View Post
    No i did not mean that, i mean you should monitor all buttons pressed and if 6 is pressed while you have a focus on text1 then text1.text=""

    hope you understood better.
    how about ... if the field is called text1...

    Code:
    private sub text1_KeyPress (KeyAscii as integer)
    
    if (KeyAscii = 65) then text1 = ""
    
    end sub
    When typing in text 1, if you type in "A", it blanks the field
    so you could do something like ..

    Code:
    dim mypwd as string
    
    private sub text1_KeyPress (KeyAscii as integer)
    
    mypwd = mypwd  + chr(keyascii)
    text1 = ""
    
    end sub
    Last edited by TcM; 02-27-2008 at 04:51 AM. Reason: Code Tags

  11. #10
    Join Date
    Aug 2006
    Posts
    11,209
    Blog Entries
    6
    Rep Power
    101
    I did not try it, but it seems like it would work.

    Nice +rep given.

    But please another time use code tags instead of color.

    Thanks

Closed Thread
Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. textBox number problem
    By Zloduh in forum C# Programming
    Replies: 3
    Last Post: 09-11-2010, 09:56 AM
  2. How to show an input of number as individual integers
    By bloodchains in forum C and C++
    Replies: 12
    Last Post: 03-14-2010, 11:36 PM
  3. to not make a random number appear twice
    By Darkyere in forum Pascal and Delphi
    Replies: 2
    Last Post: 12-03-2008, 08:30 AM
  4. How to make a number generator?
    By wazofski in forum Visual Basic Programming
    Replies: 13
    Last Post: 04-12-2008, 02:51 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts