Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Resize Box to fit text (Read 3867 times)
rachis
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 18
Joined: May 14th, 2007
Resize Box to fit text
Aug 9th, 2007 at 8:35am
Print Post  
This is a query to deal with the issue of resizing the box when the text input format differs.

There is a method resizeToFitText on a Box. It also takes in as parameter FitSize.KeepRatio/KeepHeight/KeepWidth


Can’t there be a resizeToFitText method that resizes to whatever size is appropriate for the input string? For example if the input is



Askdkjaslkdjasda

Sdasd

Asdakjsdha sjdhjas dkhasd kjasd

Asdajks

Sa



The rows and columns resize to fit this entire set of lines.

Is it also possible to get information about the size of the input text which will allow to decide the size of the box?

Please let me know how this can be done.

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Resize Box to fit text
Reply #1 - Aug 9th, 2007 at 9:46am
Print Post  
Try setting a very large initial box size and calling

box.ResizeToFitText(KeepWidth);
box.ResizeToFitText(KeepHeight);

The first call should make the box just big enough to fit the text lines, and the second - wide enough to fit them without wrapping.

Stoyan
  
Back to top
 
IP Logged
 
rachis
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 18
Joined: May 14th, 2007
Re: Resize Box to fit text
Reply #2 - Aug 9th, 2007 at 11:37am
Print Post  
I should have an idea of the width of the text input before i resize the box. Can we find the width of the text entered?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Resize Box to fit text
Reply #3 - Aug 9th, 2007 at 12:27pm
Print Post  
You could use the FlowChart.MeasureString method to find the text width.

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