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 7012875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:18:46+00:00 2026-05-27T22:18:46+00:00

i know a Windows Combobox control is nothing but a Textbox and a ListBox

  • 0

i know a Windows Combobox control is nothing but a Textbox and a ListBoxglued together.

i need to simulate the same thing in WinForms. i am trying to figure out Windows window options that must be set to achieve the proper effect.

  • the drop-down cannot be a child window – otherwise it is clipped to the parent’s area
  • conceptually it must be a pop-up window – an overlapped window
  • it can be an owned window – An owned window is always above its owner in the z-order. The system automatically destroys an owned window when its owner is destroyed. An owned window is hidden when its owner is minimized.

The best i’ve managed so far is to create

  • a borderless (this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None)
  • topmost (this.TopMost = true)
  • form that doesn’t show in the taskbar (this.ShowInTaskbar = false)

this borderless topmost form contains my “drop-down” control. i “hide” my dropdown when the dropdown form loses focus:

this.Deactivate += new EventHandler(TheDropDownForm_Deactivate);

void TheDropDownForm_Deactivate(object sender, EventArgs e)
{
   ...

   this.Close();
}

This conglomeration of mess works well enough…

enter image description here

…except that “drop-down” takes focus away from the owner form.

And this is my question, what properties should my popup window have?

  • SW_SHOWNOACTIVATE?

But then how do i hide my drop-down form when it loses focus – when it cannot lose focus?


How do i simulate a combo-box drop-down in .NET?


Note: Don’t confuse what you see in the example screenshot with something else. i am asking how to create “drop-down” form in Winforms – the contents can be different than the screenshot above:

enter image description here

  • 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-05-27T22:18:47+00:00Added an answer on May 27, 2026 at 10:18 pm

    Using a ToolStripControlHost and a ToolStripDropDown can achieve the same effect.

    From this answer:

    Private Sub ShowControl(ByVal fromControl As Control, ByVal whichControl As Control)
      '\\ whichControl needs MinimumSize set:'
      whichControl.MinimumSize = whichControl.Size
    
      Dim toolDrop As New ToolStripDropDown()
      Dim toolHost As New ToolStripControlHost(whichControl)
      toolHost.Margin = New Padding(0)
      toolDrop.Padding = New Padding(0)
      toolDrop.Items.Add(toolHost)
      toolDrop.Show(Me, New Point(fromControl.Left, fromControl.Bottom))
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know Windows has SMTP capabilities under IIS, but I thought a basic SMTP
Does anybody know of a Windows FTP client with SOCKS support? I need it
does anyone know about a windows forms control that acts like the address bar
I know of FlashDevelop for windows but how about developing actionscript or haxe on
I know a fair bit about the Windows Task Manager in XP, but I
You might not know this, but pressing the F4 key on a ComboBox makes
Does anyone know of a simple implementation of a checked combobox in WinForms? I
AutoComplete for a WPF editable ComboBox including Separator control shows System.Windows.Controls.Separator. With this xaml:
I know Windows Vista (and XP) cache recently loaded DLL's in memory... How can
Would this work on all platforms? i know windows does \r\n, and remember hearing

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.