Click here to Skip to main content
15,921,295 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: DirectX Pin
Dave Kreskowiak4-Jun-04 0:17
mveDave Kreskowiak4-Jun-04 0:17 
QuestionUi? Pin
Boggahutt872-Jun-04 13:29
Boggahutt872-Jun-04 13:29 
AnswerRe: Ui? Pin
Dave Kreskowiak3-Jun-04 3:30
mveDave Kreskowiak3-Jun-04 3:30 
QuestionHow to get the default printer? Pin
Anonymous2-Jun-04 11:45
Anonymous2-Jun-04 11:45 
AnswerRe: How to get the default printer? Pin
Dave Kreskowiak3-Jun-04 3:08
mveDave Kreskowiak3-Jun-04 3:08 
GeneralRe: How to get the default printer? Pin
Anonymous3-Jun-04 4:02
Anonymous3-Jun-04 4:02 
GeneralRe: How to get the default printer? Pin
Dave Kreskowiak3-Jun-04 4:32
mveDave Kreskowiak3-Jun-04 4:32 
GeneralRe: How to get the default printer? Pin
Dave Kreskowiak3-Jun-04 4:46
mveDave Kreskowiak3-Jun-04 4:46 
You might want to try playing with the PrinterSettings class. You can instantiate a PrinterSettings object and see what its PrinterName property says. It might be the name of the default printer. If it's blank, trying getting the InstalledPrinters property. This will be a collection of Strings that represent the printer names. You could then set the PrinterName property of the PrinterSettings object to each one of the printer names returned by InstalledPrinters and check the IsDefault property to see if it is the default printer. Warning: The following code has not been tested and is not guaranteed to even compile! That's what I get for using Notepad... Smile | :)
Dim myPrinterSettings As New PrinterSettings
If myPrinterSettings.PrinterName = "" Then
    ' The PrinterSettings object doesn't come prepackaged with
    ' the DefaultPrinter name.
    ' Start checking the list of InstalledPrinters.
Else
    ' The PrinterSettings object DID come with the DefaultPrinter!
End If
 
 
' InstalledPrinters check
Dim Index As Integer
Dim myPrinterSettings As New PrinterSettings
Dim listInstalledPrinters As String()
Dim DefaultPrinterName As String = ""
 
listInstalledPrinters = PrinterSettings.InstalledPrinters
For Index = 0 To UBound(listInstalledPrinters, 0)
    myPrinterSettings.PrinterName = listInstalledPrinters(Index)
    If myPrinterSettings.IsDefaultPrinter Then
        ' We found the DefaultPrinter!
        DefaultPrinterName = listInstalledPrinters(Index)
        Exit For
    End If
Next
' DefaultPrinterName should now contain the name of the DefaultPrinter.
' If it's empty, then this logic didn't work...



RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

GeneralRe: How to get the default printer? Pin
Anonymous3-Jun-04 4:41
Anonymous3-Jun-04 4:41 
GeneralRe: How to get the default printer? Pin
Dave Kreskowiak3-Jun-04 4:47
mveDave Kreskowiak3-Jun-04 4:47 
GeneralRe: How to get the default printer? Pin
Anonymous3-Jun-04 5:14
Anonymous3-Jun-04 5:14 
GeneralRe: How to get the default printer? Pin
Dave Kreskowiak3-Jun-04 5:44
mveDave Kreskowiak3-Jun-04 5:44 
GeneralRe: How to get the default printer? Pin
Anonymous3-Jun-04 6:37
Anonymous3-Jun-04 6:37 
GeneralLet's make more simple. Pin
Anonymous2-Jun-04 10:34
Anonymous2-Jun-04 10:34 
GeneralRe: Let's make more simple. Pin
Dave Kreskowiak3-Jun-04 2:52
mveDave Kreskowiak3-Jun-04 2:52 
GeneralModifying Selected EAP Type Pin
^eleK2-Jun-04 9:21
^eleK2-Jun-04 9:21 
GeneralRe: Modifying Selected EAP Type Pin
Dave Kreskowiak3-Jun-04 2:51
mveDave Kreskowiak3-Jun-04 2:51 
GeneralHelp needed - making vb6 LoadPicture faster Pin
steff kamush2-Jun-04 5:58
steff kamush2-Jun-04 5:58 
GeneralRe: Help needed - making vb6 LoadPicture faster Pin
Dave Kreskowiak2-Jun-04 12:31
mveDave Kreskowiak2-Jun-04 12:31 
GeneralRe: Help needed - making vb6 LoadPicture faster Pin
steff kamush3-Jun-04 0:42
steff kamush3-Jun-04 0:42 
GeneralRe: Help needed - making vb6 LoadPicture faster Pin
Dave Kreskowiak3-Jun-04 1:21
mveDave Kreskowiak3-Jun-04 1:21 
QuestionHow can I print text in Landscape? Pin
ATC2-Jun-04 5:25
ATC2-Jun-04 5:25 
AnswerRe: How can I print text in Landscape? Pin
Dave Kreskowiak2-Jun-04 12:29
mveDave Kreskowiak2-Jun-04 12:29 
GeneralADODB Connection events Pin
RichardGrimmer2-Jun-04 3:33
RichardGrimmer2-Jun-04 3:33 
GeneralRe: ADODB Connection events Pin
Dave Kreskowiak2-Jun-04 12:25
mveDave Kreskowiak2-Jun-04 12:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.