У меня есть сетка, и я хочу напечатать всю сетку grid.each в своем текстовом поле
сетка установлена на ShowGridLines = false;
, а также у меня есть метод удаления границы текстового поля.
private void DeletBorder()
{
Thickness bor = new Thickness(0.0);
for (int i = 0; i < this.gridArray.Length; i++)
{
foreach (Control ctrl in this.gridArray[i].Children)
{
if (ctrl.GetType() == typeof(TextBox))
{
((TextBox) ctrl).BorderThickness = bor;
}
}
}
}
Я пытаюсь распечатать все сетки в массиве этим методом:
private void button1_Click(object sender, RoutedEventArgs e)
{
if (this.comboBox1.SelectedIndex > -1)
{
PrintDialog printDlg = new PrintDialog();
this.DeletBorder();
if (printDlg.ShowDialog() == true)
{
this.DeletBorder();
foreach (Grid item in this.gridArray)
{
printDlg.PrintVisual(item, "Stiker Print Job");
}
}
}
else
{
MessageBox.Show("you must select the page layout first");
}
}
но в результате получается, что только первая страница печатается без border / gridLines, а другая все еще печатается с border / gridLines