rapmanesh_boys
جمعه 19 فروردین 1390, 14:50 عصر
با سلام خدمت دوستان
من هنگام اجرای دستورات زیر به خطا مواجه می شوم به نظر شما دلیل این خطا چیه؟
PrintDialog pd = new PrintDialog();
if (pd.ShowDialog() == true)
{
try
{
// Hide the Grid.
grid.Visibility = Visibility.Hidden;
// Magnify the output by a factor of 5.
mainCanvas.LayoutTransform = new ScaleTransform(2, 2);
// Print the element.
pd.PrintVisual(mainCanvas as Visual, "BarCode");
// Remove the transform and make the element visible again.
mainCanvas.LayoutTransform = null;
grid.Visibility = Visibility.Visible;
}
catch (Exception ex)
{
MessageBox.Show("Error Occurd :" + ex.Message);
}
}
68452
من هنگام اجرای دستورات زیر به خطا مواجه می شوم به نظر شما دلیل این خطا چیه؟
PrintDialog pd = new PrintDialog();
if (pd.ShowDialog() == true)
{
try
{
// Hide the Grid.
grid.Visibility = Visibility.Hidden;
// Magnify the output by a factor of 5.
mainCanvas.LayoutTransform = new ScaleTransform(2, 2);
// Print the element.
pd.PrintVisual(mainCanvas as Visual, "BarCode");
// Remove the transform and make the element visible again.
mainCanvas.LayoutTransform = null;
grid.Visibility = Visibility.Visible;
}
catch (Exception ex)
{
MessageBox.Show("Error Occurd :" + ex.Message);
}
}
68452