How is code writen for PrintPreviewDialog1 .show and show the dialog at maximum (Full Screen)

Gary Simpson 471 Reputation points
2022-03-10T15:39:29.19+00:00

Hi Good People

I have a button that shows Print Preview Dialog1, But when the Print Preview Dialog1 shows the size of the Print Preview Dialog1 is small
When I want to show the Print Preview Dialog1 at maximum ( Full Screen )

I have tried using the Print Preview Dialog1 form controls But I keep getting errors in the code.

Private Sub CmdPrintPreview_Click(sender As Object, e As EventArgs) Handles CmdPrintPreview.Click

        PrintPreviewDialog1.ShowDialog()
        PrintPreviewDialog1.Controls(MaximumSize) = True

    End Sub

is it possible to make the PrintPreviewDialog1.show at Maximum size, when the dialog shows

Kind Regards
Gary

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,756 questions
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 86,316 Reputation points
    2022-03-10T16:01:38.993+00:00

    You can do :

    DirectCast(PrintPreviewDialog1, Form).WindowState = FormWindowState.Maximized
    PrintPreviewDialog1.ShowDialog()
    
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Gary Simpson 471 Reputation points
    2022-03-10T16:20:32.747+00:00

    Hi Castorix31

    Thank you for Looking at my question and getting back to me.

    Brilliant your code works well.

    Thanks again Castorix31

    Kind Regards
    Gary

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.