-
When you set CommandButtonControl 's Caption with a "&" you
get a underline display with one character(To support shortcut). My question is HOw to make that underline in code?
Suppose I am using API Drawtext call to draw caption, any way to make one character underlined ?
Thanks
-
I dont know what ur trying to do
if u want to set only underline here is the way
select font property of commandbutton
set the underline
-
oops SOrry for misguiding u
i Mis interpretted ur ??
do this in api drawtext what ever
Instead of & char(ascii(&)) i.e. put the ascii value of ampersand
this should do the trick
-
DrawText API
Thanks for reply! But I may not be clear in my question
I would like to show a text string with one character underlined using drawtext API call. Is it possible?
Here is the API declaration
Public Declare Function DrawText Lib "user32" Alias "DrawTextA" (ByVal hdc As Long, ByVal lpStr As String, ByVal nCount As Long, lpRect As RECT, ByVal wFormat As Long) As Long
for example:
DrawText(UserControl.hDC, MyString, Len(MyString), udtTRect, DT_CENTER)
will draw MyString in specified place. The question is how to draw the text with one character underlined? If there is no such format constant for DrawText, How Can I modify the text after DrawText call?