 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Mcd Guest
|
Posted: Wed Oct 08, 2003 8:04 pm Post subject: Skip focus |
|
|
I need that the Focus skip to next component same that the key Tab,
but this need work inside component, because i'm writing an...
with VCL i used this:
keybd_event(9,0,0,0)
with Clx I try this:
SelectNext(Self, True, True);
but, don't work fine...it don't skip, stay in component !
What i can do? Have other method or function to do this?
|
|
| Back to top |
|
 |
Alexander Bauer Guest
|
Posted: Wed Oct 08, 2003 10:03 pm Post subject: Re: Skip focus |
|
|
Hi,
I did it that way:
function TYouControl.FindNextControl(CurControl: TWinControl; GoForward:
Boolean): TWinControl;
var i,StartIndex: Integer; List: TList;
begin
Result := nil;
List := TList.Create;
try
GetParentForm(CurControl).GetTabOrderList (List);
if List.Count > 0 then
begin
StartIndex := List.IndexOf (CurControl);
if StartIndex = -1 then
if GoForward then StartIndex := List.Count-1 else StartIndex := 0;
i := StartIndex;
repeat
if GoForward then begin inc(i); if i = List.Count then i := 0; end
else begin if i = 0 then i := List.Count; dec(i); end;
CurControl := List[i];
if CurControl.CanFocus and CurControl.TabStop and not(CurControl is
TawCustomRadioButton) then
Result := CurControl;
until (Result <> nil) or (i = StartIndex);
end;
finally
List.Free;
end;
end;
The function returns the next focusable control. You just need to set the
focus to it.
Regards,
Alexander Bauer
"Mcd" <mauri (AT) qualinet (DOT) com.br> schrieb im Newsbeitrag
news:3f846d50 (AT) newsgroups (DOT) borland.com...
| Quote: | I need that the Focus skip to next component same that the key Tab,
but this need work inside component, because i'm writing an...
with VCL i used this:
keybd_event(9,0,0,0)
with Clx I try this:
SelectNext(Self, True, True);
but, don't work fine...it don't skip, stay in component !
What i can do? Have other method or function to do this?
|
|
|
| Back to top |
|
 |
Jakob Guest
|
Posted: Thu Oct 09, 2003 8:28 pm Post subject: Re: Skip focus |
|
|
In Delphi I use self.Perform(WM_NEXTDLGCTL, 0, 0);
bye - JAkob
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|