Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Show Arrows with/without .Text (Read 5580 times)
lemon
YaBB Newbies
*
Offline



Posts: 28
Joined: Aug 31st, 2005
Show Arrows with/without .Text
Sep 7th, 2005 at 5:46am
Print Post  
Hello,
I gladly switch on and off the Arrow characteristic "Text" on push of a button. 

My beginning:  I provide two identical Arrows for a connection (one with Text the other one without).  Then I would set the Arrows visible=true/false with the help of a foreach loop . 

For me-seems that this beginning is not really good.  Has you a suggestion?

tnx lemon
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Show Arrows with/without .Text
Reply #1 - Sep 7th, 2005 at 8:08am
Print Post  
Hello,

Why don't you just set the arrow's Text to an empty string and restore it back when needed ? You can store a copy of the text in the Tooltip or the Tag property and get it from there when it must be shown again. Thus you will have the text in two places, but that's better than keeping a second arrow for just showing and hiding text.

Another option might be to set the TextColor to a transparent one, having an Alpha value = 0. I haven't tried this, but it's very possible that it works...

I hope that helps,
  Stoyan
  
Back to top
 
IP Logged
 
lemon
YaBB Newbies
*
Offline



Posts: 28
Joined: Aug 31st, 2005
Re: Show Arrows with/without .Text
Reply #2 - Sep 7th, 2005 at 8:43am
Print Post  
Hi,

it works!

But now:
two foreach-loops can be a obstacle for good performens. How can I change all arrows on _flowChart at one time?

foreach(Box b in _flowChart.Boxes)
{
  foreach(Arrow a in b.OutgoingArrows)
   {
     a.TextColor = System.Drawing.Color.Black;
   }
}
_flowChart.Print();
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Show Arrows with/without .Text
Reply #3 - Sep 7th, 2005 at 9:43am
Print Post  
Hi,

You must still use at least one loop on the Arrows collection:

foreach (Arrow a in _flowChart.Arrows)
  a.TextColor = ...
  
Back to top
 
IP Logged
 
lemon
YaBB Newbies
*
Offline



Posts: 28
Joined: Aug 31st, 2005
Re: Show Arrows with/without .Text
Reply #4 - Sep 7th, 2005 at 10:10am
Print Post  
Oh, I havn't saw this possibility.

thanks
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint