Hi everybody.

I have an UserControl (Windows Application - .NET Framework 3.5) which is composed of a TextBox and ListBox: it should pretty much emulate a "suggestion box" just like the ones in Google and other various search engines.
Now, the initial status of this control (TextBox blank) imply the ListBox listing the suggestions to be invisible, and that's where it comes the pain.
No matter I set the Visibility of the ListBox to false and even the BackColor of the UserControl to Transparent: it's still taking up his space greying the lower level controls.

I hope I've explained myself properly, as I'm Italian and my english is not very good. Anyway, to make it clearer, I've attached a printscreen of what is happening.

Any help is very appreciated.

Right Click and press send to back

I've already tried this, but as a result even the ListBox is sent to back, which isn't really what I want to accomplish.

ok bring the textboxes to front?

Please mark as solved if solved.

As I stated before, the result is always this (image below).

hmm, how about.

on Enter event you move make invisible and visible or play with size textbox.Left = w/e.

could you post the project? or make anew one with the same problem should be copy paste.

Solved adding the ListBox of the UserControl to the Parent Control, just like this:

if (!this.Parent.Controls.Contains(this.lstSuggestion))
    this.Parent.Controls.Add(this.lstSuggestion);

this.lstSuggestion.BringToFront();
this.lstSuggestion.Location = this.Location;
this.lstSuggestion.Width = this.Width;
this.lstSuggestion.Height = 100;
this.lstSuggestion.Visible = true;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.