Again printer setting problem in VB.NET

TeeChart for ActiveX, COM and ASP
Post Reply
M.Takeda
Newbie
Newbie
Posts: 18
Joined: Tue Aug 17, 2004 4:00 am

Again printer setting problem in VB.NET

Post by M.Takeda » Wed Sep 22, 2004 11:03 am

Thank you for your prompt reply and help me again
to check my source code attached.
This is working well using default printer only.
Printer does not change as print dialog setting.

'--------------------------------
' Put Chart and Set Print Margine
'--------------------------------
Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Fmain.MenuItem5.Checked Then
'---------------------
' Analog Page
'---------------------
With Fmain
With .AxTChart1.Printer
.PrintProportional = False
.MarginLeft = 5
.MarginTop = 5
.MarginRight = 5
.MarginBottom = 5
End With
AxTeePreviewPanel1.Orientation = TeeChart.ETeePreviewPanelOrientation.ppoLandscape
RadioButton1.Checked = True
AxTeePreviewPanel1.AddChartLink(.AxTChart1.ChartLink)
End With
ElseIf Fmain.MenuItem6.Checked Then
'---------------------
' Digital Page
'---------------------
With Fmain
With .AxTChart2.Printer
.PrintProportional = False
.MarginLeft = 5
.MarginTop = 5
.MarginRight = 5
.MarginBottom = 5
End With
AxTeePreviewPanel1.Orientation = TeeChart.ETeePreviewPanelOrientation.ppoLandscape
RadioButton1.Checked = True
AxTeePreviewPanel1.AddChartLink(.AxTChart2.ChartLink)
End With
ElseIf Fmain.MenuItem7.Checked Then
'---------------------
' Both Page
'---------------------
With Fmain
With .AxTChart1.Printer
.PrintProportional = False
.MarginLeft = 5
.MarginTop = 5
.MarginRight = 5
.MarginBottom = 50
End With

With .AxTChart2.Printer
.PrintProportional = False
.PrintProportional = False
.MarginLeft = 5
.MarginTop = 50
.MarginRight = 5
.MarginBottom = 5
End With
AxTeePreviewPanel1.Orientation = TeeChart.ETeePreviewPanelOrientation.ppoPortrait
RadioButton2.Checked = True
AxTeePreviewPanel1.AddChartLink(.AxTChart1.ChartLink)
AxTeePreviewPanel1.AddChartLink(.AxTChart2.ChartLink)
End With
End If
End Sub
'------------------------------------------
'Start Pring after execute printdialog
'------------------------------------------
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim result As DialogResult

PrintDialog1.PrinterSettings = New Printing.PrinterSettings
result = PrintDialog1.ShowDialog()

If result = DialogResult.OK Then
AxTeePreviewPanel1.PrintPage()
End If
End Sub

'------------------
'Cancel Button
'------------------
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub



I'm very sorry to attach long code.
Best Regards, Thank you very much in advance,

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Sep 27, 2004 4:19 pm

Hi Takeda,

and it does not priint any page or just a empty page ?

Post Reply