Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ActiveForms, Tabbing, and Backspace

Posted on 1998-06-05
3
Medium Priority
?
544 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 200 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

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.

Question has a verified solution.

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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

704 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