trichview.support
Re: How to select a Control by clicking a button |
Author |
Message |
Sergey Tkachenko |
Posted: 11/15/2004 11:09:39 > The code you gave me, doesn't do what I want. > I've got the following code: > void __fastcall TForm1::Button1Click(TObject *Sender) > { > TEdit* edt = new TEdit((TComponent*)NULL); > edt->OnClick = OnControlClick; > rve->InsertControl("", edt, rvvaBaseline); > if(rve->CurItemStyle == rvsComponent) > rve->SetCurrentItemExtraIntProperty(rvepResizable, 1, True); > } > //-------------------------------------------------------------------------- - The code above inserts one TEdit in the editor and make it resizable. If you want to insert it and select, use: void __fastcall TForm1::Button1Click(TObject *Sender) { TEdit* edt = new TEdit((TComponent*)NULL); edt->OnClick = OnControlClick; if (rve->InsertControl("", edt, rvvaBaseline)) { rve->SetCurrentItemExtraIntProperty(rvepResizable, 1, True); rve->SelectControl(edt); } } The code that I gave you before selects controls when clicking them with mouse. |
Powered by ABC Amber Outlook Express Converter