Multiple lines in the visio screen tip...

A

ahmadka

Hi guys. I am really sorry for creating a new thread regarding this topic,
but I was not getting any recent response on older ones..

OK, I managed to get the screentip working, I used the following code:

tempShape.get_CellsSRC((short)Microsoft.Office.Interop.Visio.VisSectionIndices.visSectionObject,
(short)Microsoft.Office.Interop.Visio.VisRowIndices.visRowMisc,
(short)Microsoft.Office.Interop.Visio.VisCellIndices.visComment).FormulaU =
"\"" + "Connecting Routers " + edges[temp].from +" and " + edges[temp].to +
"! Link Utilization: " +edges[temp].utilizationPercentage +"%! Available
Bandwidth: " +
(((int)((((100-edges[temp].utilizationPercentage)/100)*edges[temp].bandwidth)*100))/100) + "kbps" + "\"";


The only problem is, all the text I specify to be shown in the SceenTip is
begin shown is just one line. How can I make the screentip move to the next
line ? I tried the "\n" string but that didnt do the trick.....
 
J

JuneTheSecond

The lenght of a line looks constant, 60 chars.
Maximum tolat lengh seems 251 chars, 4 full lines and a short one line.
So, you would make line of always 60 chars.
If the q'ty of chars in a line is less than 60, you would fill with blunks.
It seems there is no other way.
 
J

JuneTheSecond

In my test in VBA, if length of the data of a line is less than 30, length of
the frame of comment is fixed to 30. So, my test program in VBA is as follows.
Sub Comments()
Dim txt1 As String, txt2 As String, txt3 As String, txt4 As String, txt5
Dim txt As String
txt1 = "Yoda"
txt2 = "Yoshida"
txt3 = "Kawakami"
txt4 = "Negishi"
txt5 = "Akiyama"
txt1 = AppendBlanks(txt1)
txt2 = AppendBlanks(txt2)
txt3 = AppendBlanks(txt3)
txt4 = AppendBlanks(txt4)
txt = txt1 & txt2 & txt3 & txt4 & txt5
ActivePage.Shapes(1).Cells("Comment").Formula = """" & txt & """"
End Sub

Function AppendBlanks(txt As String) As String
Dim L As Long
Dim B As String
Dim I As Long
L = Len(txt)
If L > 30 Then
MsgBox "Length of comment should be less than 30."
Exit Function
End If
For I = 1 To 30 - L
B = B & " "
Next
AppendBlanks = txt & B
End Function
 

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