Resizing Text boxes automatically when the contents inside change

Started by seberg132363, June 01, 2009, 05:48:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

seberg132363

How do I...

I have setup an object with 4 text boxes tiled vertically. The 1st and 4th are pretty static and their vertical size won't change.

The 2nd & 3rd boxes have ODBC connections to an Access DB that returns different lengths of text.

How do I "Automagiclly" make this object resize the text boxes vertically so that the text fits inside, when the text changes.

Thanks...

wapperdude

Do you want the shape to grow or the text size to shrink?
Visio 2019 Pro

Visio Guy

For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

seberg132363

I need the box to grow vertically... font to remain the same...

Will review the link... thanks!!

Nikolay

Example (fixed width, height is auto-adjusted to text width):


If you need the box to grow only up, then you could e.g. set LocPinY=0

seberg132363

Thanks Nikolay! :)

Now they resize beautifully...

Can someone point to some examples of how I go about connecting the four boxes together...

With what I have been reading, I think I need to decide which box will be the parent and then just "Pin" the bottom of that box to the top of the next and so forth...

Learning in leaps and bounds..

Wombat

You can group four boxes together. The pin for each box then becomes a coordinate inside of the group. The group's height is the sum of all four boxes. It looks like this:

Height = Sheet.1!Height + Sheet.2!Height + Sheet.3!Height + Sheet.4!Height

1,2,3,4 are ids of each shape in the group.
6'4" and full of muscle

seberg132363

Still wokring on my stencil...

and now I'm confused, I just did the formulas for height in the shape transform...

And I am not picking up the general idea on how to join these "Process" boxes together

Process 1
Process 2
Process 3
Process 4

Are stacked verticaly
Boxes 2 & 3 Have Shape Transform Height = TextHeight(TheText,2.5 in) as these boxes are connected to a db and the text contents change.

Can someone point me to an example of how to connect them together so that when boxes 2 & 3 height changes, the 4 boxes stay connected/stacked together and not overlapping...

Thanks in advance..

wapperdude

Modify shapesheets for shapes 1, 2, 3.  Shapesheet 3 needs to reference shape 4, modify as follows:

Shape Transform section:
PinY = Sheet.4!Height
LocPinY = Height*0

Where "Sheet.4" is the shape ID for text box 4. 

You need to do similarly for shapes 1 and 2.  Only shape 1 references shape 2, and shape 2 references shape 3.

Basically, you're making the each shape reference the shape underneath it.  That way, as a lower shape grows, all shape above it will track the growth.


HTH
Wapperdude
Visio 2019 Pro

seberg132363

Thank you Mr WrapperDude!!

I now have a functioning template inside of the Stencil...

This being my 2nd template and to-date the most complex, my last question (hopefully) is:

How do I get the formulas to stay when I drag the new stencil to the a new document?

After adding the template to a new document, I look at the Shapesheet, and all of the formulas are gone...

What am I missing? I R Nuwb...

wapperdude

Doh!  My bad.  ::)  :P

For ALL of the entries that you've modified in the Shape Transform section, you should put the "guard" function around them, e.g.,

PinY = guard(Sheet.4!height).
LocPinY = guard(Height*0)

Wapperdude
Visio 2019 Pro

seberg132363

Hello, I am back...

I am trying to fix an anomaly of my master, the automated shape is working almost as required except for the following...

The 4 boxes, are stacked vertically. The Second and third box resize when the text inside is changed.

Issue: After making the edits to the 2nd and 3rd boxes the outline (shapesheet shows the following in the title bar:

"Stencil:MasterName:Sheet.x <Shape>"

The outline does not match the new outline of the 4 boxes.

Just to reiterate, outline is what I call what shows selected when you click on the master the 1st time, I then click again on one of the 4 boxes to make changes to the boxes... and I cant reference the boxes parameter (height).

Thanks in advance,

S

wapperdude

By chance, did you ungroup before doing your edits?  If you did, and then regroup, that might (will) change the group ID.

Wapperdude
Visio 2019 Pro