Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Problem with TAB on a form

Posted on 1998-06-19
8
Medium Priority
?
532 Views
Last Modified: 2008-02-01
On form1 I drop about 10 Edit Controls. I move to controls with TAB key. When I'm on the 10th edit, I go to the first with tab.OK.

Next, I create  form2 as child (like a toolbar) of form1.
Now , when I'm on the 10th edit, if I press TAB, I go to the form2, then (next tab) to the first edit.

How avoid this ?
How exclude the form2 from the "tab circle" ?
I want to never set the focus to the form2 when I press TAB.
0
Comment
Question by:jpdupont
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 3

Accepted Solution

by:
vladika earned 400 total points
ID: 1354153
property TabStop
0
 

Author Comment

by:jpdupont
ID: 1354154
A form had a TabStop property ???
0
 
LVL 3

Expert Comment

by:vladika
ID: 1354155
Yes, in run-time mode

Any WinControl has TabStop property (see in help)
Some controls has public TabStop property
others controls has published TabStop property

Form has PUBLIC TabStop property

write handler OnFormCreate
  Form.TabStop := False;

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 3

Expert Comment

by:vladika
ID: 1354156
Also you can override procedure GetTabOrderList(List: TList)

For example
type
  TForm1 = class(TForm)
  public
    procedure GetTabOrderList(List: TList); override;
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.GetTabOrderList(List: TList);
var
  I: Integer;
  P: TWinControl;
begin
  inherited GetTabOrderList(List);
  if (ActiveControl = nil) or (ActiveControl.Parent = nil) then Exit;
  P := ActiveControl.Parent;
  for I := List.Count-1 downto 0 do
    if P <> TControl(List[I]).Parent then List.Delete(I);
end;
// In this example "tab circle" is controls which have same parent as ActiveControl

0
 

Author Comment

by:jpdupont
ID: 1354157
Vladika,

Thanks for the help.
1/I just try the TabStop property (OnCreate ...) : don'twork.
2/I see your comment, and I try this as soon as possible.

Thanks again
Jean-Pol
0
 

Author Comment

by:jpdupont
ID: 1354158
Hi,
Your code don't work.
I put this in the code to create a child window :

procedure TWCombo.CreateParams(var Params: TCreateParams);
begin
  inherited CreateParams(Params);
  with Params do begin
    Style := (Style or WS_CHILD) and (not WS_POPUP);
    WndParent := Application.MainForm.Handle;
  end;
  Parent := Application.MainForm;
end;

Correct ?

Regards,
JP
0
 
LVL 3

Expert Comment

by:vladika
ID: 1354159
Hi!

1) From which is TWCombo inherited?
2) Is TWCombo design-time component?
3) I think CreateParams should look as

procedure TWCombo.CreateParams(var Params: TCreateParams);
begin
  inherited CreateParams(Params);
  with Params do
    Style := (Style or WS_CHILD) and (not WS_POPUP);
end;

. and when you create TWCombo ...
W := TWCombo.Create(Form1);
W.TabStop := False;
W.Parent := Form1;
......... W initialization (set height, width etc)........

4) if you wish you can send me program by email demon@dezcom.mephi.ru or
Dmitri_Ulitski@dialogbank.com and I try to help you
5) sorry for english :)

0
 
LVL 3

Expert Comment

by:vladika
ID: 1354160
Answer is
1) use TabStop property to exclude/include control from/in "tab circle"
2) use GetTabOrderList for full "tab circle" control


0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question