printers is not a member of System.My.MyComputer?

J.G

New member
Joined
Oct 30, 2007
Messages
2
Programming Experience
Beginner
Hi i'm trying to use my.computer.printers.defaultprinter
but i get an error telling me that "printers is not a member of System.My.MyComputer"

Here's my code

VB.NET:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        With My.Computer.printers.defaultprinter

        End With

    End Sub
of course there should be more inside the with-statement, but i haven't gotten to that yet.

and at the top of the page i have in the declarations
VB.NET:
Imports System.Drawing
Imports System.Drawing.Printing

What's wrong?
I'm pretty new to VB2005 so please don't bite my head of if it's a real simple error. :)
/jonas
 
Ok, that sure explains a thing or two :D
I guess i'll have to find an alternative way, too bad seemed like a nice function. Strangly enough i found this code as an example in a book about VB2005, that's a strange approach when writing a book to include stuff that aren't included in the program. :confused:

Many thanks!
/jonas
 
Back
Top