Home > DeveloperSection > Forums > Remove a grid from window using WPF
E E Cummings
E E Cummings

Total Post:26

Points:182
Posted on    October-14-2013 7:31 AM

 C# C# 
Ratings:


 1 Reply(s)
 697  View(s)
Rate this:

I have a Grid in my WPF application :

<Grid Name="MainGrid">

    <Grid.RowDefinitions>

        <RowDefinition Height="70" Name="BarRowDef" />

        <RowDefinition Height="*"/>

    </Grid.RowDefinitions>

    <Grid Name="BarGrid" Grid.Row="0" Height="70" VerticalAlignment="Top" Background="#FF802C2C">

        <Button Content="History" Focusable="False" Width="100" Height="60" HorizontalAlignment="Left" VerticalAlignment="Center" Name="HistoryButton" Click="HistoryButton_Click"/>

    </Grid>

    <Grid Name="MiddleGrid" Grid.Row="1">

        <Grid.ColumnDefinitions>

            <ColumnDefinition Width="*"/>

        </Grid.ColumnDefinitions>

        <WebBrowser HorizontalAlignment="Stretch" Name="Browser" VerticalAlignment="Stretch" LoadCompleted="Finish_Load" Grid.Column="1"/>

    </Grid>

</Grid>

And i want to the browser will have full screen option. So what i done is in the event Of EnterFullscreen is called is :


BarRowDef.Height = new GridLength(0);

And what happen is that the Browser start from the top of the page but in the bottom i have a white space in the size of BarGrid. Any idea what can be the problem?



Andrew Deniel
Andrew Deniel

Total Post:29

Points:203
Posted on    October-14-2013 7:51 AM

I am not sure what do you mean, EnterFullscreen event of what?

You can try this:

BarGrid.Visibility = Visibility.Hidden;

instead of:

BarRowDef.Height = new GridLength(0);

Don't want to miss updates? Please click the below button!

Follow MindStick