Results 1 to 4 of 4

Thread: Commandbutton Control's Caption underline format

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2000
    Location
    BC, Canada
    Posts
    142
    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

  2. #2
    Lively Member
    Join Date
    Jan 2000
    Posts
    76
    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

  3. #3
    Lively Member
    Join Date
    Jan 2000
    Posts
    76
    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

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Jan 2000
    Location
    BC, Canada
    Posts
    142

    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?







Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width