p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   General .NET (http://p2p.wrox.com/forumdisplay.php?f=122)
-   -   Printdialog MS V.S. 2005, what to print (http://p2p.wrox.com/showthread.php?t=45073)

Turbovulc July 11th, 2006 02:19 AM

Printdialog MS V.S. 2005, what to print
 
I have windows app in MS VS 2005 express ed, which I have a controll which generates maps (axArcreadercontrol)
I can get a printout using the controls functions but this one prints on the default printer without dialog.
Code:

AxArcReaderControl1.PrintView()
I want tro be able to chose printer options (printdialog)
So In VS. I added a printdocument control and a printdialog control then using the code below.
The first sub tell what will be printed. Here I would like to specify that the "MapLayout" will be printed, not like this example with the text "What i want to print goes here" printed out.

How do I reference the MapLayoutview here instead of some text?
I can get the maplayout the way I want it printed by calling
Code:

AxArcReaderControl1.currentView = AxArcReaderControl1.ARPageLayout.ARMap(0)
Code:

 
  Private Sub PrintDocument1_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage

        'e.Graphics.DrawString("What i want to print goes here", New Font("Comic Sans MS", 20, FontStyle.Bold), Brushes.Black, 200, 200)
            End Sub

    Private Sub PrintToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintToolStripButton.Click
        'AxArcReaderControl1.PrintView()
        If PrintDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
            PrintDocument1.Print()
        End If
    End Sub

Thanks//Martin



All times are GMT -4. The time now is 04:47 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.