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.

6 Years
Discussion Span
Last Post by lucammino

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.


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.lstSuggestion.Location = this.Location;
this.lstSuggestion.Width = this.Width;
this.lstSuggestion.Height = 100;
this.lstSuggestion.Visible = true;

Edited by lucammino: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.