Setting Text property of commandButton which is part of a group

L

Lant

Setting the Text property of a commandbutton which is part of a group makes
it the Text property for the 'Group' Shape and centers it on the Group
instead of on the control. I found a few settings and props which could be
set to rectify this but in vain. The properties I have tried include
- Setting the 'Group Data' on Group Behavior (set on the master's property)
- Setting the 'IsTextEditTarget' Cell property (set programmatically to
'FALSE')


The text is set on the command button fine till I do the following to add it
to the group. The Group has no 'Text' currently. On executing the following
code, the Text property from the CommandButton is moveddown to the center of
the group.

Not sure if there is something about the sequence in which you Group, set
property, or set Text.

ActiveWindow.DeselectAll
ActiveWindow.Select
Application.ActiveWindow.Page.Shapes.ItemFromID(cmdShape.ID), visSelect
ActiveWindow.Select
Application.ActiveWindow.Page.Shapes.ItemFromID(grpShape.ID), visSelect
ActiveWindow.Selection.AddToGroup
-
 
M

Mark Nelson [MS]

In the user interface, text assigned to a group shape will either be placed
at the group level or in the topmost subshape of the group. This is
controlled by the IsTextEditTarget cell. You can programmatically check
this cell and then know whether to set the Text property of the group shape
or the subshape.
 
L

Lant

Thanks Mark
The help on the IsTextEditTarget property mentions the stacking order.
How is this determined? Can I just 'Activate' a control and bring it to the
top of the 'Stack'. This does not to seem to be the 'Z' order.


Help Info -
" FALSE - Text is added to the shape in the group at the top of the stacking
order"
Thanks


Mark Nelson said:
In the user interface, text assigned to a group shape will either be placed
at the group level or in the topmost subshape of the group. This is
controlled by the IsTextEditTarget cell. You can programmatically check
this cell and then know whether to set the Text property of the group shape
or the subshape.
 
M

Mark Nelson [MS]

Use BringToFront and SendToBack methods to change the z-order of shapes.
The z-order of a shape is the same as its index in the Shapes collection.

--
Mark Nelson
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.

Lant said:
Thanks Mark
The help on the IsTextEditTarget property mentions the stacking order.
How is this determined? Can I just 'Activate' a control and bring it to
the
top of the 'Stack'. This does not to seem to be the 'Z' order.


Help Info -
" FALSE - Text is added to the shape in the group at the top of the
stacking
order"
Thanks
 
L

Lant

The Text property of the command button is being displayed ok. I think the
problem is that I expected the Text to be displayed on the command button and
not in the center of the group. So, the 'IsTextEditTarget' only decides which
text to use and not where the text should be displayed. I guess I should set
the text position with the other properties.

Thanks
Lant
 
M

Mark Nelson [MS]

IsTextEditTarget determines the shape that will display the text. You need
to manipulate the Text Block of the shape to determine the position of the
text. This is done in the UI using the Text Block tool. This is done in
automation by changing the TxtPinX, TxtPinY, TxtWidth and TxtHeight cells.

--
Mark Nelson
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top