trichview.com

trichview.support




Re: Button inserted function


Return to index


Author

Message

Sergey Tkachenko

Posted: 04/15/2003 10:03:07


In additional: if you want to save document with buttons in RVF format, you

need to reassign event handlers in OnControlAction event (because they are

not stored in RVF).

Example can be found in Demos\Delphi\Editors\Editor 1\



> procedure TForm1.mitButtonCompClick(Sender: TObject);

> var btn: TButton;

> const Captions: array[0..9] of String =

>        ('Help','Exit','Cancel','Ok','Close','Run','Options...','Minimize',

> 'Hide','Show');

> begin

>   btn := TButton.Create(Self);

>   btn.Caption := Captions[Random(10)];

>   btn.OnClick := YourProcedure;

>   RichViewEdit1.InsertControl('',btn,rvvaBaseline);

> end;

>

> procedure TForm1.YourProcedure(Sender: TObject);

> begin

>   ShowMessage('You click me!);

> end;

>

>

>





Powered by ABC Amber Outlook Express Converter