print button on printpreview dialog

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.
 
H

Herfried K. Wagner [MVP]

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
///
 
M

Mick

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top