Click here to Skip to main content
15,892,005 members
Home / Discussions / C#
   

C#

 
GeneralRe: Moved from Q/A (originally posted by dmpinusa): Centralizing Exception Handling Code Pin
dpminusa21-Nov-10 4:46
dpminusa21-Nov-10 4:46 
AnswerRe: Moved from Q/A (originally posted by dmpinusa): Centralizing Exception Handling Code Pin
Rhys Gravell21-Nov-10 23:57
professionalRhys Gravell21-Nov-10 23:57 
Questiondatetimepicker with multiple selected dates Pin
ajithnamboodiri18-Nov-10 19:58
ajithnamboodiri18-Nov-10 19:58 
AnswerRe: datetimepicker with multiple selected dates Pin
Mycroft Holmes18-Nov-10 20:46
professionalMycroft Holmes18-Nov-10 20:46 
AnswerRe: datetimepicker with multiple selected dates Pin
RobCroll19-Nov-10 0:55
RobCroll19-Nov-10 0:55 
AnswerRe: datetimepicker with multiple selected dates Pin
Gregory Gadow19-Nov-10 9:40
Gregory Gadow19-Nov-10 9:40 
AnswerRe: datetimepicker with multiple selected dates Pin
thatraja20-Nov-10 2:13
professionalthatraja20-Nov-10 2:13 
QuestionPrint a data using GDI object in windows form Pin
ragupathi.p18-Nov-10 17:55
ragupathi.p18-Nov-10 17:55 
My requirement is print a message in inside of rectangle in windows form application and I achieved this one using PrintDocument and PrintDialog control.I have written the code as shown below:

private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)

{

Rectangle rect = new Rectangle(50, 40, 500, 150);
e.Graphics.DrawRectangle(Pens.Black, rect);

RectangleF recf = new RectangleF(55, 45, 400, 20);
e.Graphics.DrawString("Printing from Windows form",new Font("Arial",10,FontStyle.Bold ), Brushes.Black, recf);

}

My problem is If I print this message using the above code.I got the some junck line along with message but the rectange is not drawn in the print document.

The following are the output from the printer(which lines bold )

/languagelevel where {pop languagelevel} {1} ifelse dup 2 ge {currentglobal ex
0 0 10 6 [] 0 1 GpPBeg
0.0039 0.0039 0.0039 SC
NP Printing from Windows form
300 240 m 3300 240 1 330 1140 1 300 1140 1 CP
S
GSE

If I print the same message without rectangel I am able to print correct message without junk lines (above bold lines).

I am using this printer model HP LaserJet M3027 MFP PCL 6 for print

Could you please help me how to fix this issue?
I am a software Developer and have worked on Microsoft .Net technologies for about 3 Years.I always interested to read the technical articles and learn about new technologies.

AnswerRe: Print a data using GDI object in windows form Pin
Luc Pattyn18-Nov-10 18:26
sitebuilderLuc Pattyn18-Nov-10 18:26 
GeneralRe: Print a data using GDI object in windows form Pin
ragupathi.p22-Nov-10 19:24
ragupathi.p22-Nov-10 19:24 
QuestionVersioning Question Pin
Richard Andrew x6418-Nov-10 13:51
professionalRichard Andrew x6418-Nov-10 13:51 
AnswerRe: Versioning Question PinPopular
Luc Pattyn18-Nov-10 14:14
sitebuilderLuc Pattyn18-Nov-10 14:14 
GeneralRe: Versioning Question Pin
Richard Andrew x6418-Nov-10 14:18
professionalRichard Andrew x6418-Nov-10 14:18 
GeneralRe: Versioning Question Pin
Luc Pattyn18-Nov-10 14:32
sitebuilderLuc Pattyn18-Nov-10 14:32 
AnswerRe: Versioning Question Pin
Dave Kreskowiak18-Nov-10 15:25
mveDave Kreskowiak18-Nov-10 15:25 
GeneralRe: Versioning Question Pin
Richard Andrew x6418-Nov-10 15:29
professionalRichard Andrew x6418-Nov-10 15:29 
AnswerRe: Versioning Question Pin
Bernhard Hiller21-Nov-10 23:22
Bernhard Hiller21-Nov-10 23:22 
Questiongetting data over website Pin
Erdinc2717-Nov-10 21:51
Erdinc2717-Nov-10 21:51 
AnswerRe: getting data over website Pin
Pete O'Hanlon17-Nov-10 23:10
mvePete O'Hanlon17-Nov-10 23:10 
GeneralRe: getting data over website Pin
Erdinc2717-Nov-10 23:18
Erdinc2717-Nov-10 23:18 
GeneralRe: getting data over website Pin
Pete O'Hanlon17-Nov-10 23:49
mvePete O'Hanlon17-Nov-10 23:49 
GeneralRe: getting data over website Pin
Lutosław18-Nov-10 4:09
Lutosław18-Nov-10 4:09 
GeneralRe: getting data over website Pin
Pete O'Hanlon18-Nov-10 4:16
mvePete O'Hanlon18-Nov-10 4:16 
GeneralRe: getting data over website PinPopular
Lutosław18-Nov-10 5:18
Lutosław18-Nov-10 5:18 
GeneralRe: getting data over website Pin
Pete O'Hanlon18-Nov-10 9:28
mvePete O'Hanlon18-Nov-10 9:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.