Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to Navigate a TPageControl using Ctrl-Tab and Ctrl-Shift-Tab if several page Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
23-Oct-03
Category
VCL-General
Language
Delphi 2.x
Views
124
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Jonas Bilinkevicius

I have a PageControl having 3 TabSheets. If this PageControl has a Panel as its 
parent, then I am able navigate between the tabsheets using Ctrl-Tab (forward) or 
Shift-Ctrl-Tab (backward) using the keyboard. But if the same pagecontrol has 
another Tabsheet of a Pagecontrol as its parent, then I am not able to navigate 
between the tabsheets of the child pagecontrol using the keyboard even though the 
focus is on the child pagecontrol.

Answer:

Handling proper Ctrl-Tab and Ctrl-Shift-Tab switching of pages if several 
pagecontrols are on a form:

In form declaration:
1   
2   procedure CMDialogKey(var msg: TCMDialogKey); message CM_DIALOGKEY;
3   
4   procedure TForm1.CMDialogKey(var msg: TCMDialogKey);
5   var
6     Control: TWinControl;
7   begin
8     with Msg do
9     begin
10      if (charcode = VK_TAB) and (GetKeyState(VK_CONTROL) < 0) then
11      begin
12        Control := ActiveControl;
13        while Assigned(Control) do
14          if Control is TPageControl then
15          begin
16            Control.Perform(CM_DIALOGKEY, charcode, keydata);
17            Exit;
18          end
19          else
20            Control := Control.Parent;
21      end;
22    end;
23    inherited;
24  end;



			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC