30-06-2006, 11:10 PM
to get the text size of a string you can use this.
Code:
Public Declare Function GetTextExtentPoint32 Lib "gdi32" Alias "GetTextExtentPoint32A" (ByVal hdc As Long, ByVal lpsz As String, ByVal cbString As Long, lpSize As textSize) As Long
Public Function getSize(ByVal DC As Long, ByVal Text As String) As textSize
Dim lngReturn As Long
Dim typSize As textSize
lngReturn = GetTextExtentPoint32(DC, Text, Len(Text), typSize)
getSize = typSize
End Function
Public Type textSize
width As Long
height As Long
End Type