Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Change FONT SIZE for text on imported VISIO Shape (Read 2870 times)
JCRonSaratoga
YaBB Newbies
*
Offline


Go Cubs Go!

Posts: 30
Joined: Apr 15th, 2008
Change FONT SIZE for text on imported VISIO Shape
May 22nd, 2008 at 8:41pm
Print Post  
Hi
How can I change the font size for text on an imported VISIO shape?

Here is how I change the text:


For i2 = 0 To NumFlowChartShapes(0)
Dim item As DiagramItem = diag.Items(i2)
item.ToolTip = "Shape# " & Str(i2)

If TypeOf item Is ShapeNode Then
Dim shape As ShapeNode = CType(item, ShapeNode)
shape.Text = "Shape# " & Str(i2)
End If
Next


Thanks,
Jim
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Change FONT SIZE for text on imported VISIO Sh
Reply #1 - May 23rd, 2008 at 4:26am
Print Post  
Hi,

shape.Font = new Font("Comic Sans MS", 20);

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


Go Cubs Go!

Posts: 30
Joined: Apr 15th, 2008
Re: Change FONT SIZE for text on imported VISIO Sh
Reply #2 - May 23rd, 2008 at 1:17pm
Print Post  
Thanks - that worked for the text in the shapes, but not for the text on the connectors.  How can I change that text?

Thanks
Jim
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Change FONT SIZE for text on imported VISIO Sh
Reply #3 - May 23rd, 2008 at 1:46pm
Print Post  
Font is a member of DiagramItem, so you can set it through the "item" variable for both shapes and connectors. Otherwise, add a similar "if" statment for DiagramLink objects, there cast the item to a "link as DiagramLink" variable and set link.Font.

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


Go Cubs Go!

Posts: 30
Joined: Apr 15th, 2008
Re: Change FONT SIZE for text on imported VISIO Sh
Reply #4 - May 23rd, 2008 at 2:37pm
Print Post  
Thanks, that worked.  In the .vb code at load, I just set all the fonts:

       Me.view.Diagram.Font = New Font("Microsoft Sans Serif", 8)

Just to let you know.  When I used Windows Forms, I did not have set the font size, it seemed to either read it from the VISIO file, or had a default font size of "8".  However, when I moved to WPF, the default size changed to "3". Or at least it appears that is what happened.

Anyway, I am all set now.
Thanks
Jim
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint