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

Total Post:26

Posted on    October-14-2013 7:31 AM

 C# C# 

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

I have a Grid in my WPF application :

<Grid Name="MainGrid">


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

        <RowDefinition Height="*"/>


    <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 Name="MiddleGrid" Grid.Row="1">


            <ColumnDefinition Width="*"/>


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



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

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