I just added a print and printpreview capability to my app. It's
printing a nasty datagrid with hidden columns that may be filtered and
sorted.

Everything seems to work, but I'm having trouble with printing from the
printpreview form. The preview looks right, I get the right number of
pages, and the lines look right, but there is no text.

Is there some trick to make this work? If not, how do I disable the
print button from the stock printpreviewdialog. I can hear the users
complaining about this already.

Thanks,
Mick.

Re: print button on printpreview dialog by Herfried

Herfried
Sat Jun 18 08:02:49 CDT 2005

"Mick" <mickster00@hotmail.com> schrieb:
> how do I disable the
> print button from the stock printpreviewdialog.

\\\
Dim ppdlg As New PrintPreviewDialog()
With ppdlg

' Der Druckvorschau das Dokument zuweisen.
.Document = m_pd

' Die Druckvorschau soll maximiert gezeigt werden.
.WindowState = FormWindowState.Maximized

' "Drucken"-Button deaktivieren.
DirectCast(.Controls(1), ToolBar).Buttons(0).Enabled = False

' Druckvorschau anzeigen.
.ShowDialog()
.Dispose()
End With
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Re: print button on printpreview dialog by Mick

Mick
Mon Jun 20 06:47:22 CDT 2005

Herfried K. Wagner [MVP] wrote:
> "Mick" <mickster00@hotmail.com> schrieb:
>
>> how do I disable the print button from the stock printpreviewdialog.
>
>
> \\\
> Dim ppdlg As New PrintPreviewDialog()
> With ppdlg
>
> ' Der Druckvorschau das Dokument zuweisen.
> .Document = m_pd
>
> ' Die Druckvorschau soll maximiert gezeigt werden.
> .WindowState = FormWindowState.Maximized
>
> ' "Drucken"-Button deaktivieren.
> DirectCast(.Controls(1), ToolBar).Buttons(0).Enabled = False
>
> ' Druckvorschau anzeigen.
> .ShowDialog()
> .Dispose()
> End With
> ///
>

Dank. Sie der Mann.

Mick.