Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

convert vb printer code to c#

Posted on 2004-10-20
8
Medium Priority
?
283 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 1000 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

916 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