PrintPreviewDialog

  • Thread starter Thread starter brazil.samario
  • Start date Start date
B

brazil.samario

Hello,

How do I disable the print button in PrintPreviewDailog?

I have tried the following code.
DirectCast(.Controls(1), ToolBar).Buttons(1).Enabled = False
But it throw 'InvalidCastException'.

Pls assist me.

Thanks.

Cheers
 
Hello,

How do I disable the print button in PrintPreviewDailog?

I have tried the following code.
DirectCast(.Controls(1), ToolBar).Buttons(1).Enabled = False
But it throw 'InvalidCastException'.

Pls assist me.


The interiors of the PrintPreviewDailog are not documented, thus we can not
assume that .Controls(1) is of type ToolBar. Tested in VB 2003 (Framework
1.1) it is, in VB 2005 (FW 2.0) it is not.

I would only use the supported features of a component. Disabling the Button
is not.


Armin

PS: In FW 2.0, it is a ToolStrip control.
 
Back
Top