Customising the .NET PrintPreviewDialog?
Currently i'm using the PrintPreviewDialog to open a window to preview the printed pages before they are sent to a printer. The problem is though that it first appears very small, at the top left of the screen and the buttons are too small.
alt text http://img441.imageshack.us/img441/4577/printpreview.png
Is there anyway i can set a starting size for this dialog or start position or even make the little buttons a little bigg开发者_开发技巧er? Or do i need to implement my own?
You can get the toolstrip. Been a while since I used a toolstrip. But I would think you could make it work...
Dim cnts As Form.ControlCollection = Me.PrintPreviewDialog1.Controls
Dim toolstrp As ToolStrip = DirectCast(cnts(1), ToolStrip)
toolstrp.Height = 50
Dim tsbtn As ToolStripButton = toolstrp.Items(0)
tsbtn.AutoSize = False
tsbtn.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText
tsbtn.Size = New Size(65, 50)
Me.PrintPreviewDialog1.ShowDialog()
alt text http://www.freeimagehosting.net/uploads/84be8f8b72.png
This is my own PrvDialog. You can create a new Form, add to it a new ToolStrip, a PrintPreviewControl and implement your PrintPreviewDialog Funcionality.
This is a simple option. More simple than try to modify original PrintPreviewDialog behavior.
You can see sample at Code-Project. An Enhaced PrintPreviewDialog (CoolPrintPreviewDialog).
精彩评论