Giving effects to visio shapes at run time in c#

J

juliet jose

I have a program (c#) where in i drop the shapes on to the visio drawing
control. Now i need to show some visual effect (such as highlight or color
change or changing the line style or something similar) on the shape when i
have performed a particular action ,say add a text to the shape.How can i do
this?

url:http://www.ureader.com/gp/1130-1.aspx
 
K

Konrad Anton

juliet said:
I have a program (c#) where in i drop the shapes on to the visio drawing
control. Now i need to show some visual effect (such as highlight or color
change or changing the line style or something similar) on the shape when i
have performed a particular action ,say add a text to the shape.How can i do
this?

If you can get hold of the Application object, you can subscribe to the
ShapeAdded event (see the AddAdvise method of EventList) and change
colours (or whatever) from your event handler.

(AddAdvise: http://msdn.microsoft.com/en-us/library/ms367505.aspx)

How and whether to get to an Application object if you're using the
Visio drawing control as opposed to an add-in: I don't know.

HTH a little
--Konrad
 
P

Paul Herber

I have a program (c#) where in i drop the shapes on to the visio drawing
control. Now i need to show some visual effect (such as highlight or color
change or changing the line style or something similar) on the shape when i
have performed a particular action ,say add a text to the shape.How can i do
this?

url:http://www.ureader.com/gp/1130-1.aspx

To try to add slightly to Konrad's reply, it's not obvious to me
whether you are adding the shapes and editing the shape text manually
or via the automation.
 
J

juliet jose

The text is being manipulated manually at run time.I'm able to identify the
shape object whose text has been edited.But when i checked all the
properties and functions associated with a shape object i couldnt find
anything which can be used to bring in some effect at run time.

url:http://www.ureader.com/msg/11301935.aspx
 
P

Paul Herber

The text is being manipulated manually at run time.I'm able to identify the
shape object whose text has been edited.But when i checked all the
properties and functions associated with a shape object i couldnt find
anything which can be used to bring in some effect at run time.

url:http://www.ureader.com/msg/11301935.aspx

Right, in that case have a look at http://visio.mvps.org/VBA.htm
You will find many bits of useful code there (in VBA the the
principles are the same). Setting LineWeight is a good example.
 

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