I have created a custom Styledcontrol descendant, that consist out of 3 TEdit's that represent a date (Day/month/hour), the Edits are part of my .style file
When the control gets focus, the first Edit should get focus. the other edits should never get focus through tabbing. they have tabstop = false in the style file.
constructor TPWCalendar.Create(AOwner: TComponent);
Oncanfocus:=FocusEdit;
procedure TPWCalendar.FocusEdit(Sender: TObject; var ACanFocus: Boolean);
begin
ACanFocus:=false;
if Findedits then
if not FDayEdit.isfocused then
FDayEdit.SetFocus;
end;
This works, but when one of the children Edits is focused, and i press tab, the first edit of the first created custom control is selected. How to make it have default behaviour and select the next control as if it was 1 control? (So no matter where the focus lies in the control - edit1, edit2 or edit3, pressing tab should select the next control).
PS: Is there any decent firemonkey component tutorial? considering styling etc.
I have updated the question