We help IT Professionals succeed at work.

Center PrintPreviewDialog in VB.Net

1,467 Views
Last Modified: 2018-06-15
Hello Experts,

I would like to know how I could center a PrintPreviewDialog on a screen. I already tried to do it with SetDesktopLocation but it did not work. Any ideas how to solve this?

Thank you in advance,
Zoidi
Comment
Watch Question

Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Thank you for your help. Don't know why I did not try this. Anyway, thank you :)
gab2001ukSTEM Tutor

Commented:
Old post found when trying to do the same in C#. For anybody ending up here for the same reason:
You have to Cast it to Form to do the same.
PrintPreviewDialog1.ClientSize = new Size(900, 700); //change to suit
((Form)PrintPreviewDialog1).StartPosition = FormStartPosition.CenterScreen;
PrintPreviewDialog1.Show();

Open in new window

Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.