Results 1 to 6 of 6

Thread: Keep RTB Text Selection Active While Selecting Highlight Color

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jul 2001
    Location
    Tucson, AZ
    Posts
    2,166

    Keep RTB Text Selection Active While Selecting Highlight Color

    I have a combobox as part of a toolbar where I select a text background highlight color.
    Once the combobox receives focus, the RTB (richtextbox) loses the
    selected text highlight (text is there just highlight reverts to background color).
    After combobox selection the test selected previously is highlighted with the correct color
    My guess is the only workaround for this is using a ActiveX because of the need to be in a separate thread.

    Can someone confirm and Any other workaround?

  2. #2
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,622

    Re: Keep RTB Text Selection Active While Selecting Highlight Color

    So you want the text in the RTB to still look like it is highlighted when the combobox receives focus?

  3. #3
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,060

    Re: Keep RTB Text Selection Active While Selecting Highlight Color

    Is the HideSelection property what you're looking for?
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  4. #4
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,622

    Re: Keep RTB Text Selection Active While Selecting Highlight Color

    @Bonnie.....I bet it is....that works. Didn't know of that property....thanks for the info.

  5. #5
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,060

    Re: Keep RTB Text Selection Active While Selecting Highlight Color

    Sam, that property is also available in TextBoxes.
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Jul 2001
    Location
    Tucson, AZ
    Posts
    2,166

    Re: Keep RTB Text Selection Active While Selecting Highlight Color

    Thanks Bonnie West -- easy solution.

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