Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

convert vb printer code to c#

Posted on 2004-10-20
8
278 Views
Last Modified: 2008-02-01
0
Comment
Question by:tomvergote
  • 5
  • 3
8 Comments
 
LVL 8

Author Comment

by:tomvergote
ID: 12357075
nevermind got it
0
 
LVL 7

Accepted Solution

by:
God_Ares earned 500 total points
ID: 12357438
post it here then,.. so others may find it...
0
 
LVL 8

Author Comment

by:tomvergote
ID: 12360805
I went about it in a totally different way, and the solution is worthy of an article on it's own.
Posting the solution  would mean posting my whole form, and the code is my customers property so i'm not sure I'm supposed to post it in the pub domain ;)
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 8

Author Comment

by:tomvergote
ID: 12360882
I can add this:
There is a mapping in code between the win32 paper sources and the .NET papersourcekind so what i'm doing now is something like
- fill tray dropdown from .NET (the papersourcekind stuff)
- when the user clicks print, I use slightly modified code from here (I added a function to retrieve the orginal settings so i can restore them afterwards, if you look at the set function you should be able to make a get function)
http://www.codeproject.com/dotnet/NET_Printer_Library.asp
With the function from that article I set the SYSTEM printer settings and change the default tray.
- when printing is finished I restore the original system settings.

I realise this is tricky because the settings might not be restored if the program is killed or crashed, but the customer would rather have it that way than no way to select the tray.
0
 
LVL 8

Author Comment

by:tomvergote
ID: 12360902
I'm giving the points to god_ares because he has a good point and contributed to some sort of solution being posted
0
 
LVL 7

Expert Comment

by:God_Ares
ID: 12361242
well this the second easiest question I ever answered


first : http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20238436.html
but i got a grade A for it ;)


when i read:
> went about it in a totally different way, and the solution is worthy of an article on it's own.
>Posting the solution  would mean posting my whole form, and the code is my customers property so i'm not sure I'm supposed to post it in the pub domain ;)
it would be fine with me if you wanted to refund,... well thanks a lot,.. on to c# #1,

regards

Floris Briolas
0
 
LVL 8

Author Comment

by:tomvergote
ID: 12361395
grade A would've been a bit much :)
0
 
LVL 7

Expert Comment

by:God_Ares
ID: 12361479
well not complaining here,.. just,.. so easy...
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question