Board index » cppbuilder » String Grid &

String Grid &


2007-07-26 07:53:52 AM
cppbuilder71
If I type an ampersand (&) into a StringGrid cell, it types in OK but
when the cell is exited is shows as an underlined space (same as it
would on a button etc).
Is there a way to prevent this?
 
 

Re:String Grid &

"Bruce" < XXXX@XXXXX.COM >wrote in message
Quote
If I type an ampersand (&) into a StringGrid cell, it types in
OK but when the cell is exited is shows as an underlined
space (same as it would on a button etc).
That is because TStringGrid draws the cells in way that mnemonic prefix
character handling is enabled by default.
Quote
Is there a way to prevent this?
There is no way to tell TStringGrid to not do that. You will have to draw
the cells yourself manually with the OnDrawCell event, using the Win32 API
DrawText() function with the DT_NOPREFIX flag specified.
Gambit
 

Re:String Grid &

Bruce < XXXX@XXXXX.COM >wrote:
Quote

If I type an ampersand (&) into a StringGrid cell, it types
in OK but when the cell is exited is shows as an underlined
space
I do not see this behavior. The Ampersand displays correctly.
BCB6, all defaults for the TStringGrid except it's Options
property where goAlwaysShowEditor and goEditing were set to
true.
~ JD
 

{smallsort}