List Info

Thread: Make RETURN function as TAB




Make RETURN function as TAB
country flaguser name
Czech Republic
2007-08-16 16:27:53

Someone posted a request for this a little while back. How to make the
RETURN key advance to the next control?

We also have this requirement.

One solution is to put the code into the component...

// Have RETURN key
AForm:=GetParentForm(self);
if AForm<&gt;nil then
SendMessage(AForm.handle,WM_NEXTDLGCTL,0,0);

Another might be for the component to stuff the keyboard using PostKeyEx32.

In any case, we are swimming upstream against Windows and MicroSoft.

The easy solution is to enable KeyPreview for all forms, then use the
SelectNext function in the FormKeyDown routine.

This is problematic for

-memofields
-comboboxes (in the dropped down state)
-and other controls which have times when they need the RETURN key before
FormKeyDown.

Again the solution is to customize the control, or add loads of logic to a
FormKeyDown handler to check for various controls and states.

...Just wondered if there was a white paper around anywhere, or what
others might be doing. Are there better ideas/solutions I might have
missed?

Cheers

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )