print button on printpreview dialog

  • Thread starter Thread starter Mick
  • Start date Start date
M

Mick

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.
 
Mick said:
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
///
 
Herfried said:
\\\
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.
 
Back
Top