"Rick Rothstein (MVP - VB)" <
rickNOSPAMnews@NOSPAMcomcast.net>wrote in
message news:eUw4uNg$
HHA.4612@TK2MSFTNGP03.phx.gbl...
Quote
Make the font for the cell(s) Marlett and then use either "a"
or "b" (these are lower case letters) either of which will
display as a check mark (I'm not sure what the difference
between these two characters are supposed to be; they
look the same to me).
The shape and size of the glyph is the same in both cases and they are both
at the same horizontal position within the cell, but the "b" sits a little
higher up in the character cell than does the "a". Here's some code that
draws both characters at exactly the same position on the Form, the "a" in
blue and the "b" in red. I've drawn them both in outline so that you can
more easily see how the glyphs overlay each other and I've drawn blue and
red rectangles to show the characters cell (you'll only see the red
rectangle because it is the same size as the blue).
Mike
Option Explicit
Private Declare Function BeginPath Lib "gdi32" _
(ByVal hdc As Long) As Long
Private Declare Function EndPath Lib "gdi32" _
(ByVal hdc As Long) As Long
Private Declare Function StrokePath Lib "gdi32" _
(ByVal hdc As Long) As Long
Private Declare Function TextOut Lib "gdi32" Alias _
"TextOutA" (ByVal hdc As Long, ByVal x As Long, _
ByVal y As Long, ByVal lpString As String, _
ByVal nCount As Long) As Long
Private Sub Form_Load()
Dim s1 As String
AutoRedraw = True
Font.Name = "Marlett"
Font.Size = 250
ForeColor = vbBlue
s1 = "a"
BeginPath Me.hdc
TextOut Me.hdc, 0, 0, s1, Len(s1)
EndPath Me.hdc
StrokePath Me.hdc
Line (0, 0)-(TextWidth(s1), TextHeight(s1)), , B
Me.ForeColor = vbRed
s1 = "b"
BeginPath Me.hdc
TextOut Me.hdc, 0, 0, s1, Len(s1)
EndPath Me.hdc
StrokePath Me.hdc
Line (0, 0)-(TextWidth(s1), TextHeight(s1)), , B
Me.Refresh
End Sub
-