Rank: Advanced Member
Groups: Guest
Joined: 3/3/2008(UTC) Posts: 185
Thanks: 8 times
|
Hi, May I know is there anyway to check the font for the TextVObject style is available? I try using code as in the subject, but seems like it's not part of the member... We need this checking cuz sometimes, the code will jump into this kind of error Font 'Aharoni' does not support style 'Regular'.(System.Drawing) Please advice.
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 1/31/2005(UTC) Posts: 458
Was thanked: 5 time(s) in 5 post(s)
|
Hello, The value of the TextVObject.Font property is ordinary System.Drawing.Font instance. As far as I know there is no built-in way to check whether specific style is supported by the font. However I think you may use something like that to perform the check: Code:
Private Function IsStyleSupported(ByRef familyName As String, _
ByRef style As System.Drawing.FontStyle) As Boolean
Dim result As Boolean = False
Try
Dim f As New Font(familyName, 10, style)
f.Dispose()
result = True
Catch ex As System.ArgumentException
End Try
Return result
End Function
|
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.