CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2001
    Location
    Upstate, New York
    Posts
    1

    Combobox - Highlight Text

    I have a simple form with a combobox and two text fields as well as two command buttons. I want to highlight the text in the text field portion of the combobox and move the cursor to that field. Anybody able to help me do this?

    Thanks!

    Claire


  2. #2
    Join Date
    Apr 2000
    Posts
    737

    Re: Combobox - Highlight Text

    check on the property .SelLength & .SelStart

    .SelStart should be able to move the cursor

    HTH

    cksiow
    http://vblib.virtualave.net - share our codes


  3. #3
    Join Date
    May 2001
    Posts
    6

    Re: Combobox - Highlight Text

    How about something like this?


    private Sub Command1_Click()

    Dim Color as ColorConstants
    Color = vbYellow

    Combo1.BackColor = Color
    Combo1.SetFocus

    End Sub




    Or if you wanted to highlight just the text and not the backcolor then you would use the forecolor property instead.

    Hope this helps


    Mike Watkins
    CodeSprings, inc.
    Quality Assurance

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

Featured