ToolStripButton and PrintDialog (Vb.NET Beta2)
I find the Print Dialog Box is not in activate when fired by button on ToolStrip, like:
| | PrivateSub ToolStripButton1_Click(ByVal senderAs System.Object,ByVal eAs System.EventArgs)Handles ToolStripButton1.Click PrintDialog1.ShowDialog() EndSub
|
The printDialog has to be made active by clicking once before making any print options.
However, it is alright by normal buton, like:
| | PrivateSub Button1_Click(ByVal senderAs System.Object,ByVal eAs System.EventArgs)Handles Button1.Click PrintDialog1.ShowDialog() EndSub
|
Is this abug or not? Thanks.
[2146 byte] By [
jiao] at [2007-12-24]
Hi,
Just tried it and it worked perfect. Could you try specifying your owner form to one of the parameters of the showdialog method:
Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
PrintDialog1.ShowDialog(Me)
End Sub
cheers,
Paul June A. Domag
Hi Paul:
Yes. I tried in a new project. I just add a TooStrip with a button on it; a PrintDialog and a PrintDocument. No error message, it just does not gain focus, but it is very annoying. I can not figure out why.
Many thanks.
Hi,
I really have a problem reproducing your problem. Try Running the exe maybe it has a difference, here is my code on displaying the printdialo in 2005:
private void toolStripButton1_Click(object sender, EventArgs e) {
PrintDialog pd = new PrintDialog();
pd.PrinterSettings = new System.Drawing.Printing.PrinterSettings();
pd.ShowDialog();
}
cheers,
Paul June A. Domag
I have the same problem in final-version of .NET 2.0.
When I add my code to a normal Button it works fine.
But when I call printdialog.showdialog() from a toolstrip-button the form is not active :-(.
Is it a confirmed Bug? Does there exist any workaround?