WPF Reflections

Jan 16 2008   11:59PM GMT

Popup box



Posted by: Mark Shurmer
Development, C, WPF, Windows Computing

One thing that I have noticed, out there in the real world, is that people new to WPF haven’t noticed the (slightly) unsung hero Popup.
I have actually seen people spending man weeks recreating a floating window as per the popup control in WPF.

So what is it? Well it is the ancestor class for menus, tooltips and the combobox - and provides the necessary floating behaviour.

An example of using it is:

<StackPanel>
<ListBox Name=”xxx” />
<Popup PopupAnimation=”Fade” Placement=”Mouse” x:Name=”pop”>
<TextBlock Text=”ggggg” />
</Popup>
</StackPanel>

This example will show a floating window at the mouse cursor, when the mouse is in the stackpanel. Easy as pie isn’t it?

Comment on this Post


You must be logged-in to post a comment. Log-in/Register