About Shape Property..

P

plz ^^

I make .vsd file..
In .vsd file, each shape has "uesr define property"

I make window form. and drawingControl load .vsd file.
When I click the shape in the .vsd file, I want to get a "uesr define
property value.
But.. I don't know the way.

Please help me.
 
A

Al Edlund

consider
a.) drop a shape on page
b.) select the new shape
c.) open the shapes shapesheet
d.) (assumes a user section is shown) right click row in usersection =>
select insert row

al
 
P

plz ^^

Thank you for your reply
but I want that.. ^^;
a) I make .vsd file.
b) I drop some shape.
c) I input user define property each shape.
d) I make window form and load .vsd file
e) User double click the shape in window drawing control.
So the property(clicked shape) show detail in another window form.

when user double click the shape, I want to catch shape's property.
 
U

unerklarlich

Are you making a stencil yourself?

If yes, then you could do the following:
1. Run Visio in Developer mode. Goto Tools>Options>Advanced Check the "Run
In Developer mode" checkbox.
2. Define custom properties for each of the stencil shapes. While defining
these properties, check the box "Ask On Drop".

Now whenever the user drops a shape on the drawing he will be prompted to
enter values for all the custom properties that u have defined for the shape.

Now if you want the user to see this form when he double clicks on the shape
then edit the shapesheet for the master .... add "DOCMD(1312)" to the cell
EventDblClick in the Events section of the shapesheet.

Further, if using a custom form to show these values is absolutely essential
then you can read the value of these properties by using the Shapesheet
methods....

string value = vsoShape.CellsU("Prop.<You Custom Property Name>").Formula

.... and then display them on the custom form. There is one cavaet over here,
when you read a value from the shapesheet cell, it is returned with an extra
pair of quotes, you will need to trim that before using the value and while
writing back into the cell you will have to add the extra pair of quotes
around the value.

Download Visio 2003 SDK would be very helpful as it has a couple of sample
programs which convert FormulaToString and vice-versa.

Hope this helps.

Regards,
Mayank
 
P

plz ^^

Thank you for you reponse reply ^^

but. I am sorry that I don't understand.

first "then edit the shapesheet for the master .... add "DOCMD(1312)" to the
cell"
this part.. DOCMC? I don't know this..

second "string value = vsoShape.CellsU("Prop.<You Custom Property
Name>").Formula"

I make clickedshape.
but "CellsU" Method not exist.
Do I add any reference??

Please explain detail..
Thank you ^^
Have a nice day~
 
P

plz ^^

I want to clicked the shpae custom property.

So I make Shape clickedshape

If i want to obtain clickedshape's chstom property, How can i do?

I read www.mvps.org/visio
that site's reference..
For Cusom Properties,
nRows = shpObj.RowCount(Visio.visSectionProp)
for i =0 To nRows -1
set celObj = shpObj.CellSRC(Visio.visSectionProp, i, 0)
ValName = celObj.ResultStr(Visio.visNone)
..
..

I can't ,RowCount Method and CellSRC Method.
Those Method don't exist.
wht not?
 
U

unerklarlich

Sorry for replyign so late .. I was outta town for a while :).
first "then edit the shapesheet for the master .... add "DOCMD(1312)" to the

1. Right Click on the shape and click on "Show Shapesheet"
2. You will now see the shapesheet representation of the shape. It contains
many sections. Scroll down till you see the section called "Events". It
contains a cell called the "EventDblClick" cell.
3. Enter "DOCMD(1312)" in that cells value.

Now when you double click on the shape you should see the custom property
window.

second "string value = vsoShape.CellsU("Prop.<You Custom Property
Name>").Formula"
the CellsU method is available in the Shape object. Refer the Visio
Automation Reference help ...
 

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