Results 1 to 11 of 11

Thread: Select All

  1. #1

    Thread Starter
    Member king_willy's Avatar
    Join Date
    Sep 2001
    Location
    Sydney
    Posts
    61

    Select All

    G'day

    i couldnt find any topic on this but it would be sweet if someone could help me


    how the crap can i get select all to work in a text box?

    simple question, but it seems it sone that noone has thwe answer too.

    like beaing able to use ctrl + a

    cheers for any help,

    Will
    In a world without fences, who needs GATES? The penguins are a comin'!

  2. #2
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336
    Use a "Rich Text Box" instead. Then use the SelStart property.
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


  3. #3
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    Text1.SelStart = 0
    Text1.SelLength = Len(Text1.Text)
    Text1.SetFocus

  4. #4

    Thread Starter
    Member king_willy's Avatar
    Join Date
    Sep 2001
    Location
    Sydney
    Posts
    61
    hey cheers guys,

    it sure does select all,

    but is there no way to tie that to Ctrl + A

    sure i tied it to F8 for the time being, but the combo of butons is.... perplexing..


    Cheers
    Will
    In a world without fences, who needs GATES? The penguins are a comin'!

  5. #5
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    i don't know how to prevent it from beeping

    VB Code:
    1. Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
    2.  
    3.     If KeyCode = Asc("A") And Shift = vbKeyControl Then
    4.         Text1.SelStart = 0
    5.         Text1.SelLength = Len(Text1.Text)
    6.  
    7.         Text1.SetFocus
    8.     End If
    9. End Sub

  6. #6
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253
    Just a quickshot guess.

    Will this work to prevenet beeping?

    VB Code:
    1. Beep = False

  7. #7
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    Originally posted by Madboy
    Just a quickshot guess.

    Will this work to prevenet beeping?

    VB Code:
    1. Beep = False
    ......
    well first of all you should have tried it.

    and it won't work since BEEP is a function, not a variable whatever.


    and there IS a way to stop it from beeping, but it's too complicated..... involves subclassing.

  8. #8
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253
    Geez, sorry! First of all i didnt even have access to VB when i replied!

  9. #9

    Thread Starter
    Member king_willy's Avatar
    Join Date
    Sep 2001
    Location
    Sydney
    Posts
    61
    You know, i couklndt get that code working :S

    buggered if i know why

    i tried lotsa things including keypreview, but alas, no stinkin luck

    any ideas on wht the crap it dun werk??

    have any of you tried it?


    Cheers,
    Will
    In a world without fences, who needs GATES? The penguins are a comin'!

  10. #10
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336
    This will select text in a text box whent CTRL+A is pressed

    VB Code:
    1. Private Sub Text1_KeyPress(KeyAscii As Integer)
    2. If KeyAscii = 1 Then
    3. Text1.SelStart = 0
    4. Text1.SelLength = 5
    5. End If
    6. End Sub
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


  11. #11

    Thread Starter
    Member king_willy's Avatar
    Join Date
    Sep 2001
    Location
    Sydney
    Posts
    61
    phwor, great stuf man

    Cheers muchly!

    -Will
    In a world without fences, who needs GATES? The penguins are a comin'!

Posting Permissions

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



Click Here to Expand Forum to Full Width