ComboBox - set focus?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ed Stewart

    ComboBox - set focus?

    Hello. I'm creating an application that requires user input into a ComboBox,
    and I'd like to have the cursor appear in this emtpy ComboBox when the
    application starts. I had a plain TextBox, and the cursor started there
    automatically; to implement a history feature, I've moved to a ComboBox, but
    now the user needs to click on it before typing.

    How do I set focus on this item? I've tried adding a null string and calling
    comboBox.Focus( ) to no avail. I read somewhere the trick is to set the focus
    to the editable text box contained within the ComboBox, but I haven't been
    able to figure out how to do that.

    Thanks,
    -ed


  • Mohamed Enein

    #2
    RE: ComboBox - set focus?

    How about setting the TabIndex of your combobox to zero?
    --------------------[color=blue]
    >From: "Ed Stewart" <stewart_edward j@nospam.yahoo. com>
    >Subject: ComboBox - set focus?
    >Date: Mon, 6 Oct 2003 14:22:43 -0400
    >Lines: 15
    >X-Priority: 3
    >X-MSMail-Priority: Normal
    >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    >Message-ID: <eyBkWbDjDHA.15 44@tk2msftngp13 .phx.gbl>
    >Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
    >NNTP-Posting-Host: ip102.75.susc.s uscom.net 64.78.75.102
    >Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
    >Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1893 33
    >X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
    >
    >Hello. I'm creating an application that requires user input into a[/color]
    ComboBox,[color=blue]
    >and I'd like to have the cursor appear in this emtpy ComboBox when the
    >application starts. I had a plain TextBox, and the cursor started there
    >automaticall y; to implement a history feature, I've moved to a ComboBox,[/color]
    but[color=blue]
    >now the user needs to click on it before typing.
    >
    >How do I set focus on this item? I've tried adding a null string and[/color]
    calling[color=blue]
    >comboBox.Focus () to no avail. I read somewhere the trick is to set the[/color]
    focus[color=blue]
    >to the editable text box contained within the ComboBox, but I haven't been
    >able to figure out how to do that.
    >
    >Thanks,
    >-ed
    >
    >
    >[/color]

    Comment

    Working...