Have a ListBox with a Textbox autocomplete when I type a key and it has many results, my form moves all the other controls. I try to find some way for the Listbox to appear in front of the form as "zindex" or something like that. sorry for my bad English.
Loading
balakaPosted Oct 28, 2025, 3:58 AM
Cookie Clicker has revolutionized the idle gaming genre since its creation in 2013. This deceptively simple yet incredibly engaging game has captured the hearts of millions of players worldwide, turning a basic concept into a global phenomenon.
Sam HobbsPosted Oct 28, 2025, 12:19 AM
If all the other controls means items in the ListBox then you are describing a ComboBox. There are various names for (types of) ComboBoxes. The name ComboBox refers to a combination of a ListBox and a TextBox although in the Windows API TextBoxes are called Edit Controls.
Sandhiya PriyaPosted Oct 27, 2025, 9:04 AM
Your English is totally fine — and your question is very clear!
You’re describing a WinForms (Windows Forms) scenario:
You have a TextBox with autocomplete results shown in a ListBox, and when the ListBox displays many results, it pushes or moves other controls on the form. You want the ListBox to float on top, similar to a “z-index” in HTML/CSS.
Let’s fix that
Problem
When you add a
ListBoxdirectly inside the form’s layout (like in aPanel,TableLayoutPanel, or similar), it participates in the form’s layout and causes other controls to move or resize.Solution 1: Show ListBox as a Floating Control (Independent Layer)
You can make the ListBox overlay other controls by setting it to
TopMostand managing its position manually.Here’s a simple example:
What this does:
Keeps the ListBox hidden until there are results.
Positions it directly below the TextBox.
Calls
.BringToFront()so it overlaps other controls (like a popup).Does not move other controls anymore.
Solution 2: Use a Separate
Formas Popup (Best for Professional Look)If you want it to behave like a dropdown (similar to IntelliSense or combo box), create a small borderless Form and show it near your TextBox.
This gives you a clean floating popup that never interferes with other controls.
Summary