views:

225

answers:

3

Hello

I've written an 'auto-suggest' textbox user control in WPF. It behaves a little bit like the 'To' list in Hotmail, allowing the user to enter a list of items, offering suggestions when it is able.

The main controls are a a text box, a wrap panel and a list box. The text box captures user input. The wrap panel contains the text box and shows previous entries. The list box is used to show suggestions. Most of the time, the list box is hidden.

I'm using multiple instances of my control in a stack panel.

My problem is that when the list box is shown, it is included in the measurement of the height of the control. This forces the following controls in the stack panel to be shifted down, as these pictures demonstrate:

alt text

alt text

I've tried overriding the measurement of my control so not to include the list box, but this just results in the list box not being visible.

What I want to do is make the list box overlay any subsequent controls in the stack panel, like a combo box's drop down would do. However, I really don't know how to do this. Any ideas?

Thanks

Sandy

+1  A: 

Try this instead of your text box / list box combination: A Reusable WPF Autocomplete TextBox

Aviad P.
+2  A: 

You might want to have a look at the Popup control. That is what the ComboBox uses to display its options. Good luck!

gehho
A: 

Hi Sandy - Were you able to resolve this issue? I would also be interested in how you implemented your control as I am trying to do something similar and yours looks awesome.

psdev