Wrap text in Use case in Microsoft Visio
I am making a use case diagram, and the problem is:
I type some text and开发者_如何学Go it is always display in one line, making my use case elipse too big. Does anyone know how to make it go to the next line? I think this option is called wrap text in StarUML...
Thank you in advance!
Nanek
In Microsoft Visio 2007 first you need to select your shape, right click it and choose "Format", then "Protection..." and uncheck "Text" checkbox, click OK. This will allow to edit shape text. When that is done you can select your use case shape, choose "Text Tool" from standard toolbar. Use case text will appear as text box. You can hit enter where necessary and then click "Pointer Tool" to complete operation.
- Right-click the use case.
- Select "Show ShapeSheet".
- Scroll down to the "Protection" section.
- Change the value near "LockTextEdit" to
0
. - Close the ShapeSheet.
Now press F2 and edit the name. Add line breaks with Enter.
It is tedious to unprotect each use case individually. If you are starting a new diagram, you may want to unprotect one use case and copy it instead of adding new use cases from the palette.
The downside of adding line breaks to the name of use case is that when you modify its properties, the name truncates to the first line break. Luckily, use cases do not have much useful properties other than name and documentation.
When you wish to edit a shape, you need to unlock the protection attributes applied on the shape. None of the answers here have informed you how to show the "Shape Data".
- You need to select File menu on the top. Select "Options" and select "Advanced"
- Scroll down till the end and select "Run in Developer mode". Press Ok.
- Select Home menu at the top to return to your diagram.
- Right click on your Shape (let's say you're editing a Use case shape)
- Select "Show ShapeSheet" option.
- You will be able to see a window below the diagram window. In this window, scroll down until you can see the "Protection" preferences.
- Select "LockTextEdit" variable and double click and change 1 to 0. Press enter to save your preference.
- Now click on the shape and select "Text" from format menu.
- Click on the text and you will be able to Edit it. Press Enter key in between the text where you need to insert line break.
Procedure for applying Word Wrap:
Select from the diagram area an element for which to apply Word Wrap.
Right-click and select the [Format] -> [Word Wrap Name] menu.
Perform the steps above once again to removed Word Wrap.
First remove the protection on the Text by: right click the use case and select "Format" then "Protection", uncheck "Text"
Next, select the use case again then press the key "F2" and now you can enter your text. press the key "Enter" to edit more than one line Enjoy
Real text wrap; no bloody carriage returns.
Visio 2010. SysML Stencil (source unknown) 'Activity' shape in 'Activity Diagram' shapes collection.
- If you cannot see the 'Developer' tab on the ribbon:
- File > Options > Customize Ribbon > [Select 'Developer' in 'Main Tabs' list]
- Right-click shape of interest and select 'Show Shapesheet'
- Find the width property of interest
- Text Transform > TxtWidth
- Change the formula in the TxtWidth property cell
- from (something like) '=MAX(Char.Size,TEXTWIDTH(TheText))'
- to '=MIN(Width-0.08,MAX(Char.Size,TEXTWIDTH(TheText)))'
- Enjoy.
The magic here is the decrementer -0.08. Without it, I couldn't make the shape any smaller because the formula would not allow the text width to be smaller than the shape width, and the shape width appeared to automatically limit itself to, at minimum, the text width. Fun. You may find you need a larger decrementer or that you can get away with a finer one.
Save the shape to which you've made this change into the stencil if you can.
Here is the quick/dirty VBA I used to apply the formula change across all the 'Action' blocks:
Public Sub ApplyWrapTextPropertyToAllActionBlocks()
Const STR_ACTION_BLOCK_NAME As String = "Action with Wrap Text."
Const STR_DECREMENTER As String = "-0.08"
Dim objShape As Shape
Dim objActionBlock As Shape
For Each objShape In ActivePage.Shapes
If InStr(1, objShape.Name, STR_ACTION_BLOCK_NAME, vbBinaryCompare) <> 0 Then
Debug.Print "Found one: " & objShape.Name
Set objActionBlock = objShape
objActionBlock.CellsU("TxtWidth").Formula = "=MIN(Width" & STR_DECREMENTER & ",MAX(Char.Size,TEXTWIDTH(TheText)))"
End If
Next objShape
End Sub
I found that by putting extra spaces in between the words I could get Visio to wrap the text. I had to add enough spaces so that it would push a word beyond the margin of the use case's textbox. Sometimes this would cause a line break between two different words, so I had to add additional spaces elsewhere in the use case name.
This does cause the use cases to be displayed oddly in Visio's Model Explorer task window but this didn't bother me.
Try editing the TextBox properties in the object properties dialog.
Select the shape. use this menu: [Home] -> [Tools] -> [Text] now text editing is available on the shape. Now by just hitting shift+enter on every place you want to end the line, you can wrap text manually. Good Luck
click into the text box and hit enter between the text you want on the next line.
精彩评论