Solved

ActiveForms, Tabbing, and Backspace

Posted on 1998-06-05
3
543 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
[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
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month7 days, 4 hours left to enroll

623 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