Click here to Skip to main content
16,004,833 members
Home / Discussions / C#
   

C#

 
GeneralRe: ComboBox Problem Pin
Dave Kreskowiak16-Jan-07 10:05
mveDave Kreskowiak16-Jan-07 10:05 
GeneralRe: ComboBox Problem Pin
Darren D16-Jan-07 10:15
Darren D16-Jan-07 10:15 
QuestionWindows Events Pin
Monin D.16-Jan-07 8:18
Monin D.16-Jan-07 8:18 
AnswerRe: Windows Events Pin
Christian Graus16-Jan-07 8:23
protectorChristian Graus16-Jan-07 8:23 
AnswerRe: Windows Events Pin
Luc Pattyn16-Jan-07 8:26
sitebuilderLuc Pattyn16-Jan-07 8:26 
AnswerRe: Windows Events Pin
Dave Kreskowiak16-Jan-07 9:30
mveDave Kreskowiak16-Jan-07 9:30 
QuestionShowing two different printdocuments in single Print Preview dialog? Pin
kumar.bs16-Jan-07 8:08
kumar.bs16-Jan-07 8:08 
AnswerRe: Showing two different printdocuments in single Print Preview dialog? Pin
Luc Pattyn16-Jan-07 8:24
sitebuilderLuc Pattyn16-Jan-07 8:24 
I have not done this, but I guess it is not hard to do.

I assume there is a single page of grid and a single page of chart, and you want
to combine them on a single page.

I further assume the grid and chart each are paintable on screen; rather than doing
it in the PaintHandler directly, I would provide an indirection, something like:

private void XXX_Paint(object sender, System.Windows.Forms.PaintEventArgs e) {
XXX_Painter(e.Graphics, 0, 0, Width, Height);
}

private void XXX_Painter(Graphics g, int x, int y, int width, int height) {
// normal paint actions
}

so the actual painting is handled in a method that accepts 4 ints (or one rect) to
indicate the painting bounds. For screen painting inside a panel, the origin would be 0,0
and the size would be Width,Height of the panel itself.

Now the printdoc:
- in the printDoc constructor, attach a PrintPage handler (as always):
PrintPage+=new PrintPageEventHandler(PrintDoc_PrintPage);
- in the PrintPageEventHandler, call both XXX_Painter methods, each with an
appropriate set of x,y,width,height values
- optionally do some more g.DrawString() to annotate the graphics.

Hope this is helpfull.

Smile | :)


Luc Pattyn

GeneralRe: Showing two different printdocuments in single Print Preview dialog? Pin
kumar.bs16-Jan-07 9:15
kumar.bs16-Jan-07 9:15 
GeneralRe: Showing two different printdocuments in single Print Preview dialog? Pin
Luc Pattyn16-Jan-07 9:55
sitebuilderLuc Pattyn16-Jan-07 9:55 
GeneralRe: Showing two different printdocuments in single Print Preview dialog? Pin
kumar.bs16-Jan-07 12:52
kumar.bs16-Jan-07 12:52 
GeneralRe: Showing two different printdocuments in single Print Preview dialog? Pin
Luc Pattyn16-Jan-07 13:05
sitebuilderLuc Pattyn16-Jan-07 13:05 
GeneralRe: Showing two different printdocuments in single Print Preview dialog? Pin
kumar.bs16-Jan-07 13:25
kumar.bs16-Jan-07 13:25 
GeneralRe: Showing two different printdocuments in single Print Preview dialog? Pin
Luc Pattyn16-Jan-07 13:49
sitebuilderLuc Pattyn16-Jan-07 13:49 
GeneralRe: Showing two different printdocuments in single Print Preview dialog? Pin
Luc Pattyn17-Jan-07 7:24
sitebuilderLuc Pattyn17-Jan-07 7:24 
GeneralRe: Showing two different printdocuments in single Print Preview dialog? Pin
kumar.bs18-Jan-07 10:52
kumar.bs18-Jan-07 10:52 
Questionproblem with <iframe> tag. Pin
hdv21216-Jan-07 7:38
hdv21216-Jan-07 7:38 
AnswerRe: problem with <iframe> tag. Pin
ednrgc16-Jan-07 8:32
ednrgc16-Jan-07 8:32 
GeneralRe: problem with <iframe> tag. Pin
hdv21216-Jan-07 9:02
hdv21216-Jan-07 9:02 
GeneralRe: problem with <iframe> tag. Pin
ednrgc16-Jan-07 9:04
ednrgc16-Jan-07 9:04 
QuestionDropDownList Problem Pin
fahiemulleh16-Jan-07 7:01
fahiemulleh16-Jan-07 7:01 
AnswerRe: DropDownList Problem Pin
Darren D16-Jan-07 8:23
Darren D16-Jan-07 8:23 
AnswerRe: DropDownList Problem Pin
Christian Graus16-Jan-07 8:24
protectorChristian Graus16-Jan-07 8:24 
QuestionUnkown array length of arrays; How? Pin
T.Willey16-Jan-07 6:40
T.Willey16-Jan-07 6:40 
AnswerRe: Unkown array length of arrays; How? Pin
T.Willey16-Jan-07 7:04
T.Willey16-Jan-07 7:04 

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.