473,480 Members | 1,711 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

printdialog

Is it possible to send a performclick to a button on a printdialog?

I know you can do an if statement similar to:

if windows.forms.dialogresult.cancel then
msgbox("User cancelled print option")
end if

But I would like to open the print dialog and automatically perform the
"Print" button to save the user one more step.

Thanks much!
Aug 29 '06 #1
4 4924
You can't send a click event to an open PrintDialog.

However, you can get around this by automating the print job in the
background, and avoiding the PrintDialog all together.

If you're interested in how to accomplish this, let me know, and I'll go
into greater detail.

--
"Quae narravi, nullo modo negabo."
"mafandon" wrote:
Is it possible to send a performclick to a button on a printdialog?

I know you can do an if statement similar to:

if windows.forms.dialogresult.cancel then
msgbox("User cancelled print option")
end if

But I would like to open the print dialog and automatically perform the
"Print" button to save the user one more step.

Thanks much!
Aug 30 '06 #2
Sure - I'd love to hear some details!

I should make note that it's a custom sized/pre-formatted paper that the
reportviewer prints on.
"UsualDosage" wrote:
You can't send a click event to an open PrintDialog.

However, you can get around this by automating the print job in the
background, and avoiding the PrintDialog all together.

If you're interested in how to accomplish this, let me know, and I'll go
into greater detail.

--
"Quae narravi, nullo modo negabo."
"mafandon" wrote:
Is it possible to send a performclick to a button on a printdialog?

I know you can do an if statement similar to:

if windows.forms.dialogresult.cancel then
msgbox("User cancelled print option")
end if

But I would like to open the print dialog and automatically perform the
"Print" button to save the user one more step.

Thanks much!
Aug 30 '06 #3
What is the source of the item you are printing? Crystal Report, Word Doc,
Text File...?

Give me some more specifics about what exactly you are trying to
automatically print, and I'll see what I can do to help.

--
"Quae narravi, nullo modo negabo."
"mafandon" wrote:
Sure - I'd love to hear some details!

I should make note that it's a custom sized/pre-formatted paper that the
reportviewer prints on.
"UsualDosage" wrote:
You can't send a click event to an open PrintDialog.

However, you can get around this by automating the print job in the
background, and avoiding the PrintDialog all together.

If you're interested in how to accomplish this, let me know, and I'll go
into greater detail.

--
"Quae narravi, nullo modo negabo."
"mafandon" wrote:
Is it possible to send a performclick to a button on a printdialog?
>
I know you can do an if statement similar to:
>
if windows.forms.dialogresult.cancel then
msgbox("User cancelled print option")
end if
>
But I would like to open the print dialog and automatically perform the
"Print" button to save the user one more step.
>
Thanks much!
Aug 30 '06 #4
It's none of those.

I'm using the reportviewer control in VB 2005 with local report /
reportembeddedresource of a .rdlc extension.
Here's a little bit of the code for when the reportviewer completes loading:

Private Sub ReportViewer1_RenderingComplete(ByVal sender As Object,
ByVal e As Microsoft.Reporting.WinForms.RenderingCompleteEven tArgs) Handles
ReportViewer1.RenderingComplete
Try

ReportViewer1.SetDisplayMode(Microsoft.Reporting.W inForms.DisplayMode.PrintLayout)
ReportViewer1.PrintDialog()

If Windows.Forms.DialogResult.Cancel Then
frmInvoices.Show()
Me.Close()
End If

Catch ex As Exception

End Try
End Sub

Thanks!
"UsualDosage" wrote:
What is the source of the item you are printing? Crystal Report, Word Doc,
Text File...?

Give me some more specifics about what exactly you are trying to
automatically print, and I'll see what I can do to help.

--
"Quae narravi, nullo modo negabo."
"mafandon" wrote:
Sure - I'd love to hear some details!

I should make note that it's a custom sized/pre-formatted paper that the
reportviewer prints on.
"UsualDosage" wrote:
You can't send a click event to an open PrintDialog.
>
However, you can get around this by automating the print job in the
background, and avoiding the PrintDialog all together.
>
If you're interested in how to accomplish this, let me know, and I'll go
into greater detail.
>
--
"Quae narravi, nullo modo negabo."
>
>
"mafandon" wrote:
>
Is it possible to send a performclick to a button on a printdialog?

I know you can do an if statement similar to:

if windows.forms.dialogresult.cancel then
msgbox("User cancelled print option")
end if

But I would like to open the print dialog and automatically perform the
"Print" button to save the user one more step.

Thanks much!
Aug 30 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5901
by: aimee | last post by:
Hi. Is there a way to capture the events fired in a PrintDialog? I would like to capture when the user presses "Print" so I can do some cleanup. The asp.net (IE6) application I'm working on has 6...
3
2476
by: John O'Neill | last post by:
Hi In C# I would like to be able to set the printer device for printing a document without using the PrintDialog. I am writing a pocket pc application which uses a web service to print. I can...
2
3183
by: David | last post by:
Does anybody know how to check the AllowSelection radio button in the PrintDialog Dialog? I want to set this to checked if the user has selected a subset of text.
1
3864
by: mphanke | last post by:
Hi, I wrote a userControl w/ a toolbar. One button is supposed to open the PrintDialog. When I use the control in a different project and click that button - the form simply closes and the...
4
5376
by: Steph. | last post by:
Hi, Is there a BUG in the printdialog ? When I create a PrintDialog ans set the "DefaultPageSettings.Landscape" property to "false" and then display the dialog, select "Landscape" and click OK,...
1
2605
by: Blaine | last post by:
When I show my Windows Form as a dialog box (ShowDialog(Me)) and click on a button that calls the ShowDialog of either the PageSetupDialog or PrintDialog conrtol, my Windows Form closes After I...
0
1293
by: Nícolas Rodrigo Santana | last post by:
I am working in an application where I use the Visio Screen, come of: "AxMicrosoft.Office.Interop.VisOcx.AxDrawingControl" Everything this functioning correctly, but when I print this not...
10
15289
by: choupi | last post by:
Hello, Is there a way to call a printDialog from a printPreviewDialog (from print icon for example)? Indeed, the print icon in the printpreviewdialog prints directly the document without...
2
7575
by: Artie | last post by:
Hi, I've searched the web but can't find a solution to an apparently really simple problem. My app contains an HTML string and I need to be able to invoke the Print Dialog to print the HTML...
0
7040
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6905
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7041
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7080
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
6908
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5331
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4772
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4478
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2994
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.