Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic set a boxposistion to the last page (Read 2433 times)
shil
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 22
Joined: Aug 9th, 2007
set a boxposistion to the last page
Aug 13th, 2007 at 8:01am
Print Post  
hi there. i got some boxes that i want to print on the last page of my chart. i will attach this boxes to the right bottom conor of the last page, but i got no idea how i can do that.

my current code loks like this:

mXPosition = flowChart1.DocExtents.Right;
mYPosition = flowChart1.DocExtents.Bottom;

foreach (Thing item in mAllThings)
{

    Box newBox = flowChart1.CreateBox




     (mXPosition, mYPosition, 30, 15);



     newBox.Style = BoxStyle.Rhombus;

     newBox.Text = item.Text;





p.s: or can i add boxes to text in a box.
for example: i got a big box with text inside. now i want to give every text item in the box a small "subbox" to explane what the boxtyps meen.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: set a boxposistion to the last page
Reply #1 - Aug 13th, 2007 at 9:22am
Print Post  
Hi,

You could create your own PrintDocument, attach a PrintPage event handler, and call the FlowChart.Print(PrintDocument) method. From the PrintPage handler, call DrawString to draw the description texts.

Stoyan
  
Back to top
 
IP Logged
 
shil
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 22
Joined: Aug 9th, 2007
Re: set a boxposistion to the last page
Reply #2 - Aug 13th, 2007 at 2:19pm
Print Post  
hm, sorry but i have no idea how it could work.
  
Back to top
 
IP Logged
 
shil
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 22
Joined: Aug 9th, 2007
Re: set a boxposistion to the last page
Reply #3 - Aug 14th, 2007 at 7:32am
Print Post  
ok i got it Smiley
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: set a boxposistion to the last page
Reply #4 - Aug 14th, 2007 at 9:05am
Print Post  
Should look like

Code
Select All
void miPrint_Click(object sender, EventArgs e)
{
	PrintDocument doc = new PrintDocument();
	doc.PrintPage += new PrintPageEventHandler(doc_PrintPage);
	diagramView1.Print(doc);
}

void doc_PrintPage(object sender, PrintPageEventArgs e)
{
	string text = "test";
	Font font = new Font(FontFamily.GenericSerif, 20);
	SolidBrush brush = new SolidBrush(Color.Green);
	PointF location = new PointF(e.PageBounds.Width * 4 / 5, e.PageBounds.Height * 4 / 5);

	e.Graphics.DrawString(text, font, brush, location);
}
 



Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint