trichview.com

trichview.support




Re: SelectAll+Repaint = Access Violation


Return to index


Author

Message

Sergey Tkachenko

Posted: 04/03/2004 18:04:41


const WM_SELECTALL = WM_USER+10;


In form declaration

procedure WMSelectAll(var Msg: TMessage); message WM_SELECTALL;


Implementation


procedure TForm3.WMSelectAll(var Msg: TMessage);

begin

  RichViewEdit1.SelectAll;

  richviewedit1.repaint;

end;


procedure TForm3.FormKeyDown(Sender: TObject; var Key: Word;

  Shift: TShiftState);

begin

  if (key=65) and (ssCtrl in shift) then

   PostMessage(Handle, WM_SELECTALL, 0, 0);

end;




> Sergey Tkachenko wrote:

> > 1) instead of using OnKeyDown, assign this shortcut to menu or actions

> > or

> > 2) in OnKeyDown, use PostMessage to post your own message to the form.

Call

> > SelectAll in the message handler (I can make an example, if you need)

> I've tried second way, but with the same results. It's interesting to

> see your example.





Powered by ABC Amber Outlook Express Converter