Article | 60000485 |
Type | HowTo |
Product | Engine |
Version | 6 |
Date Added | 4/23/2008 |
Submitted by | Sheena Konikkara |
Keywords |
Private Function GetTextSize(ByVal TextString As String, ByVal tstyle As VectorDraw.Professional.vdPrimaries.vdTextstyle, ByVal Height As Double, ByRef duHeight As Double, ByRef duWidth As Double) As BooleanduWidth = 0 : duHeight = 0
'Add a check like : If tstyle is nothing/null or textstring is empty exit sub
If tstyle Is Nothing Then Return False
If TextString Is Nothing Or TextString = "" Then Return False
Dim text As VectorDraw.Professional.vdFigures.vdText = New VectorDraw.Professional.vdFigures.vdText()
text.SetUnRegisterDocument(VectorDrawBaseControl1.ActiveDocument)
text.setDocumentDefaults()
text.Style = tstyle
text.TextString = TextString
text.Height = Height
text.Update()
duWidth = text.BoundingBox.Width
duHeight = text.BoundingBox.Height
Return True
End Function