I have created a Listbox that remains hidden until the textbox above it gains focus. The idea being to minimize screen real estate when the list box is no in use. What I need to make happen, however, for my particular view, is to have the Listbox (when it becomes visible) span across a grid that is positioned below it. Is this possible to do? How? Combo boxes will display across other grids when they are opened. That is pretty much what I need to achieve with a Listbox.....
Loading
TomPosted Dec 22, 2008, 12:03 PM
TomPosted Dec 22, 2008, 12:02 PM
Bechir BejaouiPosted Dec 22, 2008, 9:44 AM
Leung Yat ChunPosted Dec 22, 2008, 7:04 AM
I guess this is what you wanted, I just posted an article for similar subject as well, you may want to take a look.
Bechir BejaouiPosted Dec 22, 2008, 5:24 AM
TomPosted Dec 21, 2008, 8:08 PM
Bechir BejaouiPosted Dec 21, 2008, 10:43 AM
copy and paste this code in your XAML editor
Grid.Column="0"
Width="150"
Height="30" FocusableChanged="TextBox_FocusableChanged" LostFocus="txtBox_LostFocus" MouseEnter="txtBox_MouseEnter">
Width="150"
Height="120"
/>
copy and paste this code into your C# code
private void Window_Loaded(object sender, RoutedEventArgs e)
{
if (txtBox.Focus())
{
this.Height = 150;
}
}
private void txtBox_LostFocus(object sender, RoutedEventArgs e)
{
this.Height = 324;
}
private void txtBox_MouseEnter(object sender, MouseEventArgs e)
{
if (txtBox.Focus())
{
this.Height = 150;
}
}