Solved

convert vb printer code to c#

Posted on 2004-10-20
8
275 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
 
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now