🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.language.objectpascal
Article #210

Re: A simple quetion

#210
From: Jim McKay
Date: Mon, 26 Jan 2004 17:06
52 lines
2255 bytes
Feza wrote:

> i defined below procedure in seperate unit in order to it from all
> forms' DBEdit's evets.However, it gives me error on line
> "SelectNext".I could not either be able to solve or understand that
> since i included almost all units in uses clause.Hope that's clear to
> you..

As I understand, you just want routine to tab forward/backward
through TabOrder, correct?

If so, this works:

>  TKeyHndlr = Class
>    procedure TabNext (Sender: TObject; var Key: Char);
>  end; 
  
> implementation

> Type
>   THack = class (TWinControl);
> 
> procedure TKeyHndlr.TabNext (Sender: TObject; var Key: Char);
> var aCurr, aNext: TWinControl;
> 
> begin
>   if (Key = #13) and (Sender is TWinControl) then begin
>       aCurr := TWinControl(Sender);
>       aNext := THack(aCurr.Parent).FindNextControl (
>           aCurr,
>           HiWord(GetKeyState(VK_SHIFT)) <> 0,
>           True,
>           True);
>       if aNext <> nil then
>         aNext.SetFocus;
>     end;
> end;

if you Create TKeyHndlr  instance and assign your KeyPress 
event in constructor as you did elswhere, it works for me.

-- 
Regards:
Jim McKay

" I was provided with additional input that was radically different
  from the truth. I assisted in furthering that version. "

Oliver North
Iran Contra Hearings 

Posted with: XanaNews 1.15.8.5 
Technical Details
Message-ID: <40155712@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!news.belwue.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4012ed90@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 109d30,12a8917f3c14f275
X-Google-Attributes: gid109d30,public
X-Google-ArrivalTime: 2004-01-26 10:10:50 PST
From: "Jim McKay" <jmckay@california.com>
Subject: Re: A simple quetion
Newsgroups: borland.public.delphi.language.objectpascal
References:  <4012ed90@newsgroups.borland.com>
Organization: Jim McKay
User-Agent: XanaNews/1.15.8.5
X-Face: #wL=EF(&canKSL,}vfr!mz7~(B_,d:-Dp"4!aM{DX@:6^"{.Ohs]$v`3_[|]GM}MB59,'Os
 fg%>kgkfe18]5u."H9,ZvL_H
NNTP-Posting-Host: 66.81.118.72
Message-ID: <40155712@newsgroups.borland.com>
Date: 26 Jan 2004 10:06:10 -0700
X-Trace: newsgroups.borland.com 1075140370 66.81.118.72 (26 Jan 2004 10:06:10 -0700)
Lines: 52
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!news.belwue.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail