How to set focus to a comboBox on a form?

Posted on 2007-08-08
Last Modified: 2013-11-05
Hi, I'm using .net 2 for windows application.  How to set focus to a comboBox on a form?  On this form on the right I have a tree and on the left I have a couple of comboBox and a couple of textboxes.  How can I set focus to one of the comboBox when the form is loaded initially?  Currently, the focus is on the root node of the tree.  In the formload, I have put comboBox.Focus(); as the last line of code but it's still not working.  thank you.
Question by:lapucca
    LVL 69

    Accepted Solution

    try to put your line (comboBox.Focus(); ) into the Activate event

    Author Comment

    Worked great!  Thank you.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
    This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now