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.
 

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

Back
Top