Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. DrawText !!

DrawText !!

Scheduled Pinned Locked Moved C / C++ / MFC
help
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hatemtaleb
    wrote on last edited by
    #1

    Hi everybody, I'am using the DrawText function to draw this text "p&m": DrawText(_T("p&m"),LPRECT(CRect(0,0,100,100)),DT_LEFT); but my problem is that the text on the screen appear with the 'm' underlined. could someone help me!! thanks.

    M M 2 Replies Last reply
    0
    • H hatemtaleb

      Hi everybody, I'am using the DrawText function to draw this text "p&m": DrawText(_T("p&m"),LPRECT(CRect(0,0,100,100)),DT_LEFT); but my problem is that the text on the screen appear with the 'm' underlined. could someone help me!! thanks.

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      Either double the & character, or use the DT_NOPREFIX flag (i.e. specify DT_LEFT | DT_NOPREFIX). This feature is intended for use by various Windows functions to indicate accelerator keys for activating controls. Windows 2000 and higher, by default, hide the accelerator key indicators until the Alt key is pressed, so you may not have seen this behaviour. Stability. What an interesting concept. -- Chris Maunder

      1 Reply Last reply
      0
      • H hatemtaleb

        Hi everybody, I'am using the DrawText function to draw this text "p&m": DrawText(_T("p&m"),LPRECT(CRect(0,0,100,100)),DT_LEFT); but my problem is that the text on the screen appear with the 'm' underlined. could someone help me!! thanks.

        M Offline
        M Offline
        mikanu
        wrote on last edited by
        #3

        What you are experiencing is windows' method of representing shortcuts. So what you have to do in order to get the text "p&m" is to use the folowing ampersand escape sequence:

        DrawText(_T("p&&m"), LPRECT(CRect(0,0,100,100)), DT_LEFT);
        

        For more details look up escape characters on msdn

        H 1 Reply Last reply
        0
        • M mikanu

          What you are experiencing is windows' method of representing shortcuts. So what you have to do in order to get the text "p&m" is to use the folowing ampersand escape sequence:

          DrawText(_T("p&&m"), LPRECT(CRect(0,0,100,100)), DT_LEFT);
          

          For more details look up escape characters on msdn

          H Offline
          H Offline
          hatemtaleb
          wrote on last edited by
          #4

          DrawText(_T("Thank you Mike && mikanu for your help"), LPRECT(CRect(0,0,100,100)), DT_LEFT | DT_NOPREFIX) ;)

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups