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

Bechir BejaouiRank #144 · 15.9K reputationPosted Dec 21, 2008, 5:43 AM EST
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;
}
}
Tom7 reputationPosted Dec 21, 2008, 3:08 PM EST
Bechir BejaouiRank #144 · 15.9K reputationPosted Dec 22, 2008, 12:24 AM EST
Leung Yat ChunRank #9,604 · 204 reputationPosted Dec 22, 2008, 2:04 AM EST
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 BejaouiRank #144 · 15.9K reputationPosted Dec 22, 2008, 4:44 AM EST
Tom7 reputationPosted Dec 22, 2008, 7:02 AM EST
Tom7 reputationPosted Dec 22, 2008, 7:03 AM EST