Board index » delphi » RichEdit : first problem

RichEdit : first problem

I want write Card char (spade, heart, diamond, club) when I press special
keys (as @, # or others, because card chars don't exist on the keyboard) in
a RichEdit. So, it's another font (Symbol) which is necessary to use, and I
don't know if it's possible to do this, and ... how to write it !

Thanks

 

Re:RichEdit : first problem


Quote
In article <69sltp$pd...@peuplier.wanadoo.fr>, Jean-Paul Passama wrote:
> I want write Card char (spade, heart, diamond, club) when I press special
> keys (as @, # or others, because card chars don't exist on the keyboard) in
> a RichEdit. So, it's another font (Symbol) which is necessary to use, and I
> don't know if it's possible to do this, and ... how to write it !

Jean-Paul,

if you want to do it in code it is fairly simple. Find out the character code
to use from the CharMap application that comes with Windows. Assign this to
the SelText property of your rich edit to instert the character into the
control. Then set Sellength to 1 and change the SelAttribute.Name to Symbol.

  With richedit1 Do Begin
    SelText := Chr(168);
    SelLength := 1;
    SelAttributes.Name := 'Symbol';
  End;

To see how to enable your user to change the font on a selection he made, see
the richedit demo application that comes with Delphi.  

Peter Below (TeamB)  100113.1...@compuserve.com)

Other Threads