Solved

ActiveForms, Tabbing, and Backspace

Posted on 1998-06-05
3
538 Views
Last Modified: 2006-11-17
When I create an ActiveForm in Delphi 3 with more than one windowed control (TEdits, for example), I find that someone viewing the ActiveForm from within IE4 cannot use the tab key to go to the next field or use the backspace key to modify the text they just entered.  IE4 apparently traps the TAB and BackSpace keys, not allowing the edit controls or the ActiveForm to recieve them.  How can I get around this limitation?  Or, rather, what should I do to allow tabbing from control to control and using the backspace key within an ActiveForm while it is viewed within a browser?
0
Comment
Question by:descikartus
3 Comments
 
LVL 6

Expert Comment

by:edey
ID: 1350882
Have you tried setting the form's keypreview (I think) prop. to true.  This way you may be able to trap specific keys first.
0
 

Author Comment

by:descikartus
ID: 1350883
Actually, I'm looking for a way to "enable" the ActiveForm to accept these keys as it would if it were a TForm.  Right now, it appears as if Internet Explorer, for example, is treating the entire ActiveForm as one "control" and so you can only tab to it and then off it, instead of tabbing within it.  I hope that makes sense.
0
 

Accepted Solution

by:
belgianbasman earned 100 total points
ID: 1350884
I think you could "trap" the keyboard input in the OnKeyDown event of the form, and check to see if it is a TAB.

If it is a TAB, use the following function :

function FindNextControl(CurControl: TWinControl;
       GoForward, CheckTabStop, CheckParent: Boolean): TWinControl;

This function returns the control that you want to make the active control after a press of the TAB key.  You need to supply the currently active control as the first parameter, and the three booleans.  The first one specifies wether to go forward or backward. You might want to go backward when SHIFT is pressed down while receiving the TAB key. Check for this with a TShiftState.
If you set the second boolean to true, only those controls that have TabStop property set to true will be used as TabStop points.
If you set the third boolean to true, the function will try to go to the first control that is a child of the currentcontrol.  For instance, when you have two edit-boxes in a groupbox, and a comboBox next to the groupBox, and the groupbox is currently active, pressing TAB with the third boolean on true would cause the first Editbox in the Groupbox to be active.  If it is fase, this would result in the combobox to gain focus.

The most common appearance for this function would then be :

Form.ActiveControl:=Form.FindNextControl(Form.ActiveControl,True,True,True);

Other possibility:

{test for SHIFT being pressed}
{if SHIFT pressed then}
Form.ActiveControl:=Form.FindNextControl(Form.ActiveControl,True,True,True);
{else}
Form.ActiveControl:=Form.FindNextControl(Form.ActiveControl,False,True,True);

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
FMX enumerated colours 2 84
Delphi - replicating a form 8 62
How to debug For loops? 3 45
Firemonkey DbLookupComboBox equivalent ? 2 32
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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

932 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now