Results 1 to 7 of 7

Thread: CmbTruckTyp

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2009
    Posts
    1,058

    CmbTruckTyp

    Hi,

    I have a form called Form1, on it I have a combobox (cmbTruckTyp) that has databounded to it from a datasource. At run time the first value is highlighted in 'blue' and the cursor blinks.

    What I want to achieve at runtime is, a) the blue (focus) be transparent and the cursor blinking removed.

    How can I achieve this please?

    Many thanks

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: CmbTruckTyp

    It sounds like you have left the DropDownStyle at the default DropDown instead of changing it to DropDownList.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2009
    Posts
    1,058

    Re: CmbTruckTyp

    Ok the cursor has been resolved.. But still it has the blue highlight (focus)..

    How can I resolve this

    Many thanks

  4. #4

    Re: CmbTruckTyp

    Why do you want the focus to not be blue? I'm just curious.

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2009
    Posts
    1,058

    Re: CmbTruckTyp

    Thought can make it transparent instead - Mean it is on focus but no highlightment

  6. #6

    Re: CmbTruckTyp

    I don't see a purpose for removing the highlight; it shows the control has focus. I don't think you can change that short of changing the Windows theme, but I could be wrong.

  7. #7
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: CmbTruckTyp

    As suggested, the highlighting of the control indicates that that control has focus. By default, when a form is displayed it will be the first control in the Tab order that receives focus. If you want a different control to have focus initially then you must either change the Tab order of your controls or else explicitly set focus to that control AFTER the form has been displayed. If you don't want any control to have focus then you also do that explicitly, also after the form is displayed.

    If you want to do something immediately after the form is displayed then you handle the form's Shown event. If you want to set focus to a specific control then you call that control's Select method. If you don't want any control to have focus then you set the form's ActiveControl property to Nothing.

    To suggest that the control have focus but not be highlighted is a bit silly. The whole point of the highlight is as a visual cue to the user. If there's no highlight then how does the user know where the focus is? The Windows interface works in a particular way in pretty much every Windows application for a reason. Users come to expect certain behaviour and if they don't see that behaviour then the application becomes confusing. A confusing application is a bad application.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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