1

I'm using GDI+ to draw a string but it does not act like windows DrawText when it comes to honoring the & in front of the a char. It just draws & and not underlines next char. Maybe there is an option to turn it on/off? Please help.

Wodzu
  • 6,932
  • 10
  • 65
  • 105
serge
  • 1,590
  • 2
  • 26
  • 49

1 Answers1

4

It is difficult to provide a complete answer when we cannot see the code you are currently using to critique where the problem might lie, or even which implementation of the GDI+ API you are using.

The best I can do is provide you with references to the relevant documentation for the underlying GDI+ API's most likely to be involved.

First: DrawString, used to actually draw text.

Second: The StringFormat object passed to DrawString to control aspects of the rendering of the supplied string.

Finally: The HotKeyPrefix enumeration used in the StringFormat object which indicates how hot key prefixes (ampersands) are to be handled.

In your case you are looking for HotkeyPrefixShow behaviour. (The current behaviour you describe is that for HotkeyPrefixNone)

Deltics
  • 22,162
  • 2
  • 42
  • 70
  • The StringFormat worked, the problem was I could not see the overloaded method that supports StringFormat from the implementation I used – serge May 14 '15 at 13:23