Results 1 to 4 of 4

Thread: Command button select all[Resolved]

  1. #1

    Thread Starter
    Lively Member DsgnrsTLZAdmin's Avatar
    Join Date
    Jan 2004
    Location
    Jackson, Georgia
    Posts
    74

    Command button select all[Resolved]

    How do you have a command button select all the text in a rich textbox? The command button is on a form named frmMain and the rich textbox is on a form called edit and the rich textbox itself is called editor. Thanks
    Last edited by DsgnrsTLZAdmin; Jan 25th, 2004 at 11:38 AM.
    Designers Toolz Admin
    http://www.designerstoolz.com/

  2. #2
    Fanatic Member TheVader's Avatar
    Join Date
    Oct 2002
    Location
    Rotterdam, the Netherlands
    Posts
    871
    Use SelStart and SelLength, as in the example below. Make sure the HideSelection property of the RTB is set to False, or you won't see much...
    VB Code:
    1. Private Sub Command_Click()
    2. frmMain.editor.SelStart = 0
    3. frmMain.editor.SelLength = Len(frmMain.editor.TextRTF)
    4. End Sub
    Author for Visual Basic Web Magazine

    My articles on the Web Browser Control:
    Using the Web Browser Control & Using the DHTML Document Object Model

    The examples referenced in the articles can be found here:

  3. #3

    Thread Starter
    Lively Member DsgnrsTLZAdmin's Avatar
    Join Date
    Jan 2004
    Location
    Jackson, Georgia
    Posts
    74
    Works great TheVader. I have to say, you really know what your doing. Thanks man.
    Designers Toolz Admin
    http://www.designerstoolz.com/

  4. #4
    Frenzied Member
    Join Date
    May 2003
    Location
    So Cal
    Posts
    1,564
    Please edit your original post and add [Resolved] to your Subject.

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