asked on
Public Sub Printing()
Try
streamToPrint = New StreamReader(filePath)
Try
printFont = New Font("Arial", 10)
Dim pd As New PrintDocument()
AddHandler pd.PrintPage, AddressOf pd_PrintPage
pd.PrinterSettings.PrinterName = printer
' Set the page orientation to landscape.
pd.DefaultPageSettings.Landscape = True
pd.Print()
Finally
streamToPrint.Close()
End Try
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
ASKER
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
ComboBox1.Items.Clear()
For Each printer As String In Printing.PrinterSettings.InstalledPrinters
ComboBox1.Items.Add(printer)
Next printer
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If Me.ComboBox1.SelectedItem IsNot Nothing Then
Shell(String.Format("rundll32 printui.dll,PrintUIEntry /y /n ""{0}""", ComboBox1.SelectedItem))
End If
End Sub
ASKER
ASKER
ASKER
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
ComboBox1.Items.Clear()
For Each printer As String In Printing.PrinterSettings.InstalledPrinters
ComboBox1.Items.Add(printer)
Next printer
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If Me.ComboBox1.SelectedItem IsNot Nothing Then
Shell(String.Format("rundll32 printui.dll,PrintUIEntry /y /n ""{0}""", ComboBox1.SelectedItem))
End If
End Sub
ASKER
ASKER
ASKER
ASKER
ASKER
ASKER
ASKER
ASKER
ASKER
The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.
TRUSTED BY
Open in new window
Else please post the code that you are trying and I can help further.