开发者

Customising the .NET PrintPreviewDialog?

开发者 https://www.devze.com 2022-12-23 06:32 出处:网络
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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消