BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Skip focus

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Writing
View previous topic :: View next topic  
Author Message
Mcd
Guest





PostPosted: Wed Oct 08, 2003 8:04 pm    Post subject: Skip focus Reply with 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
Alexander Bauer
Guest





PostPosted: Wed Oct 08, 2003 10:03 pm    Post subject: Re: Skip focus Reply with quote



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





PostPosted: Thu Oct 09, 2003 8:28 pm    Post subject: Re: Skip focus Reply with quote



In Delphi I use self.Perform(WM_NEXTDLGCTL, 0, 0);

bye - JAkob


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Writing All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.