J'ai une application qui fonctionne sur différents écrans. J'ai préparé des formulaires en format A4 dans ma fenêtre. quand je cours sur mon PC il n'y a pas de problèmes aussi bien que sur un téléviseur 42 pouces. J'ai essayé d'installer l'application sur un autre ordinateur de 22 pouces et l'écran coupe ma fenêtre visuellement et en impression. il suit mon XAML et le code C# pour l'impressionapplication wpf exécuté sur différents écran
<StackPanel Background="White" Height="29.7cm" Width="19.5cm" >
<StackPanel Name="StackFoglioA4Pag1" HorizontalAlignment="Center" Margin="20" Background="White">
<!--<TextBox HorizontalContentAlignment="Center" BorderBrush="Black" Text="ciane S.p.A." VerticalContentAlignment="Center" IsReadOnly="True" FontWeight="Bold" FontFamily="Times New Roman" FontSize="14"></TextBox>
<TextBox Padding="2" HorizontalContentAlignment="Center" BorderBrush="Black" BorderThickness="1,0,1,1" Text="Main "- VerticalContentAlignment="Center" IsReadOnly="True" FontFamily="Times New Roman" FontSize="9"></TextBox>
<TextBox Padding="2" HorizontalContentAlignment="Center" BorderThickness="1,0,1,1" BorderBrush="Black" Text="textggggggg " VerticalContentAlignment="Center" IsReadOnly="True" FontFamily="Times New Roman" FontSize="9"></TextBox>-->
<DockPanel Margin="0,5,0,0">
<!--etc etc
public static void StampaStackPanel(StackPanel StackPanel,string message)
{
PrintDialog stampa = new PrintDialog();
if (stampa.ShowDialog() != true) return;
stampa.PrintVisual(StackPanel,message);
}
modifier:
dans mon pc je vois l'image complète dans l'autre moniteur (plus) je le vois coupé
Son pas très claire, ce que vous essayez de faire? Ouvrez la boîte de dialogue d'impression dans un autre écran Windows ?? –
désolé. J'ai un bouton qui imprime simplement le panneau de la pile (format A4) sur une feuille A4. le problème est que sur mon pc il n'y a pas de problèmes. tandis que dans un autre PC, il coupe le panneau de la pile sur l'écran et l'impression – Disaji
Vérifiez cette réponse, il peut aider: https://stackoverflow.com/questions/6606750/show-dialog-box-at-center-of-its -parent –