up vote 2 down vote favorite
3
share [g+] share [fb]

I have simple window. This is what happens when I click ComboBox: Screenshot List appears in upper left corner of screen instead of under Combobox.

XAML:

<Window x:Class="WpfPortOfTestingCamera.VideoSettings"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Video Settings" WindowStartupLocation="CenterOwner" ResizeMode="NoResize" ShowInTaskbar="False" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" SizeToContent="WidthAndHeight" d:DesignHeight="167">
    <StackPanel Name="stackPanel1" VerticalAlignment="Top" HorizontalAlignment="Center">
        <GroupBox Header="Settings" Name="groupBox1">
            <Grid Name="grid1" VerticalAlignment="Center" HorizontalAlignment="Center">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="80*" />
                    <ColumnDefinition Width="175*" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Label Content="Resolution:" Height="28" Name="label1" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                <Label Content="Framerate:" Height="28" HorizontalAlignment="Left" Margin="0" Name="label2" VerticalAlignment="Center" Grid.Row="1" />
                <ComboBox Grid.Column="1" Height="23" HorizontalAlignment="Left" Margin="0" Name="comboBox1" VerticalAlignment="Center" Width="150" SelectionChanged="comboBox1_SelectionChanged" />
                <ComboBox Height="23" HorizontalAlignment="Left" Margin="0" Name="comboBox2" VerticalAlignment="Center" Width="150" Grid.Column="1" Grid.Row="1" SelectionChanged="comboBox2_SelectionChanged" />
            </Grid>
        </GroupBox>
        <Label Name="labelSelectedSize" Content="Size @ FPS" />
        <Button Name="button1" Content="Apply" Click="button1_Click" />
    </StackPanel>
</Window>
link|improve this question

It could be related to this: stackoverflow.com/questions/1998024/… – MarcelDevG Jan 13 '11 at 8:45
2  
Works ok for me. What do you have in the code behind? – Andrei Pana Jan 13 '11 at 10:03
@Andrei Pana It happened when I opened this window in the Loaded Event from another. I realy need fix for that. – Hooch Jan 13 '11 at 14:30
6  
Instead of opening it directly in the Loaded event, just queue another message on the Dispatcher to open it. – Kent Boogaart Jan 13 '11 at 16:01
feedback

2 Answers

up vote 1 down vote accepted

Instead of opening it directly in the Loaded event, just queue another message on the Dispatcher to open it.

link|improve this answer
+1 Kent Boogaart. – sixlettervariables Feb 13 '11 at 19:58
feedback

Couldn't reproduce the problem. This works just fine for me. I opened the window from the Loaded event of another (both with and without the Dispatcher) as well as directly (as the main window).

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.