When calling up a PrintPreviewDialog that fails because the printer is
invald, a nice error is given in the catch-blok.
But, when the same call is redone, the error states that it isn't
possible to show a modal dialog when another is still active.

        Try
            PrintPreviewDialog.ShowDialog()
        Catch ex As Exception
            MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Selected
printer issue")
        End Try

(this normal error after 1st call)
---------------------------
Selected printer issue
---------------------------
Settings to access printer 'HP LaserJet 3390 / 3392 PCL5' are not
valid.
---------------------------
OK
---------------------------

(this error after 2nd call)
---------------------------
Selected printer issue
---------------------------
Form that is already displayed modally cannot be displayed as a modal
dialog box. Close the form before calling showDialog.
---------------------------
OK
---------------------------

Tried in then Catch-block PrintPreviewDialog.Document =
Nothing, .Close, .Dispose, ...
Closing the form where the PrintPreviewDialog-object resides on and
reopenning it, does the job.
Can't find out what is hanging around.


Thanks,

Reply via email to