Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

convert vb printer code to c#

Posted on 2004-10-20
8
Medium Priority
?
282 Views
Last Modified: 2008-02-01
0
Comment
Question by:tomvergote
[X]
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
  • 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
Independent Software Vendors: 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

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…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
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…
Suggested Courses

721 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