TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Namiq Aliyev
NA
40
967
Drawing inside PrintDocuments Page Margin is impossible
Dec 9 2014 6:03 AM
I want to print a rectangle in inside of a A4 paper.
When i say inside the paper i mean in boundary of Page Margins. There are three controls on my form.
PrintDocument
,
PageSetupDialog
,
PrintPreviewDialog
This is capture of PageSetupDialog in my program.
And code for PrintPage event of the PrintDocument is below.
private
void
printDocument_PrintPage
(
object
sender
,
PrintPageEventArgs
e
)
{
Graphics
gr
=
e
.
Graphics
;
Rectangle
r
=
e
.
MarginBounds
;
Pen
pen
=
new
Pen
(
Brushes
.
Black
,
1.0F
);
gr
.
DrawRectangle
(
pen
,
r
.
Left
,
r
.
Top
,
r
.
Right
,
r
.
Bottom
);
}
But the result is not what i expected.
Where is the right side of the rectangle?
Why it shifted to the right?
How can i draw into real PageMargins?
English ยป
AfrikaansAlbanianArabicArmenianAzerbaijaniBasqueBengaliBelarusianBulgarianCatalanChinese (Simp)Chinese (Trad)CroatianCzechDanishDutchEnglishEsperantoEstonianFilipinoFinnishFrenchGalicianGeorgianGermanGreekGujaratiHaitian CreoleHebrewHindiHungarianIcelandicIndonesianIrishItalianJapaneseKannadaKoreanLaoLatinLatvianLithuanianMacedonianMalayMalteseNorwegianPersianPolishPortugueseRomanianRussianSerbianSlovakSlovenianSpanishSwahiliSwedishTamilTeluguThaiTurkishUkrainianUrduVietnameseWelshYiddish
Options
:
History
:
Help
:
Feedback
Text-to-speech function is limited to 100 characters
Reply
Answers (
2
)
WebBrowser object in thread....
Control arrangements