Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7786277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:23:28+00:00 2026-06-01T20:23:28+00:00

Gretings I need to have a custom control for my application. Basically its an

  • 0

Gretings

I need to have a custom control for my application. Basically its an expression editing GUI. You have, say, expression:

If variable_x is greater than variable_y

And you can click on “greater than” and change it to other comparator (like, equal to or less than).

The control thus must look like a label, but when you click it, it must show a dropdown (like combobox does) that has a listview inside (or maybe some other control) so that user can choose something. In a sense, i need a combobox without the box itself, replaced by something else (in this case, a label).

I know how to make custom controls, i understand i must somehow DropDown on mouse click or enter keypress, and hook events so that when whatever i dropped has closed, the choice is made, and also somehow track if user clicked elsewhere so i can close this dropdowned control. But i dont know if this is easy to do (some built-in method exists) or i have to do it all myself? Dont want to redevelop the wheel….

Please tell me if there are easy ways to do this.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:23:29+00:00Added an answer on June 1, 2026 at 8:23 pm

    You can extend the ComboBox control to update the DropDownStyle on Enter and LostFocus events.

    public partial class MyComboBox : ComboBox
    {
        public MyComboBox()
        {
            InitializeComponent();
    
            this.Dock = DockStyle.Fill;
    
            this.SelectionChangeCommitted += this.OnComboBoxSelectionChangeCommitted;
            this.Enter += this.OnControlEnter;
            this.LostFocus += this.OnComboBoxLostFocus;
        }
    
        private void OnControlEnter(object sender, EventArgs e)
        {
            this.DropDownStyle = ComboBoxStyle.DropDownList;
        }
    
        private void OnComboBoxLostFocus(object sender, EventArgs e)
        {
            this.DropDownStyle = ComboBoxStyle.Simple;
        }
    
        private void OnComboBoxSelectionChangeCommitted(object sender, EventArgs e)
        {
            // Notify to update other controls that depend on the combo box value
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Greetings. I have a need to have a 'child' modal opended from a colorbox
Greetings good people - I need some help. I have until now buildt web-pages
SO buddies, greetings. I have some password requirements I need to implement and one
Greetings, I have one file - more or less a greylisting file. I need
today i need your help to get an specific sql select query. i have
Grettings everyone. I have a current url: http://localhost/product/?product_id=12&slug=state-of-trance-2011 I need to change it to:
well i need to make a class called TList which have a private attribute
Gretings, I have cross compile, OpenSSl , libssh2 and finally cURL, Don't know why
Greetings, I'm trying to write my first iPhone app. I have the need to
greetings all, i have multi sub-domain on my domainname.com , i need to redirect

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.