Please give me ahint how to focus programatically on the specified item added.
For example i add a Text Edit like this:
TspSkinEdit * edit = new TspSkinEdit(this);
RichView1->AddControlEx("",edit,-1,rvvaBaseline);
RichView1->Format();
int ItemNo = RichView1->ItemCount-1;
I got the item number, how can i focus in the added Text Edit ?
Thank you
P.S. I tried RichView1->RVData->FocusedItemNo = ItemNo; but does not focus...
How to focus on the speciefied inserted item
-
- Site Admin
- Posts: 17534
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
The simplest way is to call edit->SetFocus() after this code.
(If you know item index, check if this item really contains a control (RichView1->GetItemStyle(ItemNo)==rvsComponent, then get this control (RichView->GetControlInfo), and call SetFocus for the retrieved control. But if you already has it assigned to the "edit" variable, it is not necessary)
(If you know item index, check if this item really contains a control (RichView1->GetItemStyle(ItemNo)==rvsComponent, then get this control (RichView->GetControlInfo), and call SetFocus for the retrieved control. But if you already has it assigned to the "edit" variable, it is not necessary)