2015-03-17 4 views
0

J'ai utilisé le contrôle WindowsFormsHost pour afficher le document pdf dans la même fenêtre où j'avais le contrôle de la grille. Maintenant, la grille n'est pas visible lorsque windowsformshost est visible. J'ai besoin d'afficher les deux contrôles en même temps.Comment afficher le contrôle windowsformshost et la grille wpf dans la même fenêtre?

S'il vous plaît quelqu'un peut-il m'aider à afficher les deux contrôle ensemble.

ceci est mon code

ViewDocument doc = new ViewDocument("Hide", "R1B", "", "Chapters", ""); 
      doc.windowsFormsHost1.Visibility = Visibility.Visible; 
      var uc = new Pdfdocument(quespath); 
      doc.windowsFormsHost1.Child = uc; 
      doc.Show(); 

    if (fmtyp == "Hide") 
     { 
      transgrid.Visibility = Visibility.Visible; 
     } 

code XAML -

<Canvas Grid.ColumnSpan="9" Grid.RowSpan="6" Margin="3,0,0,1" Name="canvas1" Grid.Column="5" Grid.Row="6"> 
     <WindowsFormsHost Name="windowsFormsHost1" Visibility="Hidden" Canvas.Left="6" Canvas.Top="0" Height="557" Width="881" /> 
     <Grid Name="transgrid" Canvas.Left="6" Canvas.Top="0" Height="557" Width="875"> 
      <Grid.Background> 
       <ImageBrush ImageSource="/RaptorHscIIBlueprint;component/Images/1409934598_Help.png" /> 
      </Grid.Background> 
     </Grid> 
</Canvas> 
+0

soin de montrer le code? – Muds

+0

ajoutez votre code xaml ainsi – Muds

+0

hi @Muds c'est mon code. – Chinna

Répondre

0

Vos commandes résident sur le dessus de l'autre - essayer -

<StackPanel Grid.ColumnSpan="9" Grid.RowSpan="6" Margin="3,0,0,1" Name="stackPanel1" Grid.Column="5" Grid.Row="6"> 
    <WindowsFormsHost Name="windowsFormsHost1" Visibility="Hidden" Height="557" Width="881" /> 
    <Grid Name="transgrid" Height="557" Width="875"> 
     <Grid.Background> 
      <ImageBrush ImageSource="/RaptorHscIIBlueprint;component/Images/1409934598_Help.png" /> 
     </Grid.Background> 
    </Grid> 

bien
+0

désolé @muds .its ne fonctionne pas. J'ai besoin de montrer la grille sur le contrôle windowsformshost – Chinna

+0

il y a une image comme arrière-plan, qui éclipsera votre contrôle – Muds

+0

ce n'est pas un problème. – Chinna