Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 5 Jahren, 2 Monaten
Letzter Beitrag:
vor 5 Jahren, 2 Monaten
Beteiligte Autoren:
Scott Daughtry, Al, RichardRose, GuenterP, Peter Holemans, Ola, DerekT

WD17: Memo fields, TABS and TAB key behavior

Startbeitrag von Scott Daughtry am 11.03.2013 19:20

In previous languages, when I designed data entry forms I would commonly place memo fields on their own tab of a multi-tabbed form.

With WD17, I noticed that if I place a memo field as the first field on a tab (e.g. tab #2), when I press CTTL-TAB to move from the first tab to the second tab the cursor is placed inside of the memo field (which is good and what I want). However, if I press CTL-TAB (to return back to tab #1), an indentation within the memo field takes place instead of cycling through the tabs.

I can defeat the indentation behavior (which is bad) within the memo field, but that means that I can't use the keyboard to select the memo field - I have to use the mouse to select the memo field, which is self defeating for a typist to use in a proficient manner.

Is there a workaround to prevent the CTRL-TAB from indenting the memo field (if the memo field is the only field on that tab) and instead only cycling through tabs (like every other Windows application)?


Hi Scott,

I can feel your pain for the unwanted behaviour of WD.
If nothing elese helps, you can always use shift+control+tab to move backward in tabs.


von Ola - am 11.03.2013 19:39
Hello Scott

In the "GUI" section of the control editor you will find an option to "Accept TAB in edit" make sure it is off.

In fact it is a good choice to always set it off if you use memory tables and build them with TableAdd() instead of TableAddLine(), because TableAdd() uses the TAB as a separator and any TABs inside the data destroy the table line build.
I am assuming that TableAddLine() was PCSoft's way around this issue.


von Al - am 11.03.2013 23:55
Hi Al,

If I turn the "Accept TAB in Edit" to off, then when the tab is selected on the data entry form the enduser has to take their hands off of the keyboard, grab the mouse, manually select the memo field, and then start typing - ruins the rhythm of a typist to reach for a mouse . I have the memo field currently configured like that, but I dislike turning it off (for the reason stated in the preceding sentence). I was hoping another WD developer had figured out a fix (e.g. place a hidden control on the tab to allow the CTRL-TAB to work as normal without disabling the memo field)....


von Scott Daughtry - am 12.03.2013 00:17
Hello Scott

If the memo field is the first field you need to enter when the tab is selected, can you use a ScreenFirst() or ReturnToCapture() when the tab is selected in the selection code of the tab ?

Switch Tab
Case 1
Case 2
End Case


von Al - am 12.03.2013 00:56
After playing around with options last night, I am of the opinion that the CTRL-TAB keystroke within the memo field itself needs to somehow be disabled; when those keystrokes are executed within the memo field it performs the same action as the TAB key (i.e. pushes all text to the right); in other applications the CTRL-TAB is reserved strictly for navigating forward through onscreen tabs.

Does anyone have an idea on how to trap the CTRL-TAB within a memo field that is displayed on a form window and force it's behavior back to cycling forward through onscreen tabs versus indenting text contained within the memo?

von Scott Daughtry - am 13.03.2013 15:38
Hi Scott,

You can capture the keystroke with KeyPressed and navigate yourself to the next tab page.
Something like:
If KeyPressed() = CTRL+TAB then
TabControl = TabControl+1

von Peter Holemans - am 13.03.2013 16:32
Just had a play...

You can use

Tab1 = 3 //or whichever

This will move to the next tab BUT this is captured after the edit control so when you return to tab 1 the memo field will still be indented - means you also have to play with the ..cursor in order to reset.

To use KeyPressed as above you need to specify EXTERN "KeyConst.wl" in the project init code

von DerekT - am 13.03.2013 16:34
Hi, if nothing helps then you have to catch the Event of hitting the Tab key when within the Edit control. Usually, the Event-catching works before any control-internal functions are activated. Regards, Guenter

von GuenterP - am 13.03.2013 17:58
A work around might be to associate a hot key to select each tab, eg tab 1 could CTRL+1, tab 2 could be CTRL+2 and so on.

The problem is how is the text control supposed to know whether you want to tab in it or tab to the next control. You need someway for the user to tell the program they want to use ctrl-tab to move back a tab or tab back in the text control. Maybe have a toggle option toggled by using a hot key which swaps the tab behaviour between the text control or the navigation would be another work around.

von RichardRose - am 21.03.2013 22:43
I am very hestitant to break Microsoft standards for keystroke navigation hotkeys (TAB, Shift Tab, etc)... somehow other languages are intelligent enough to trap the CTRL-TAB within a memo field and know it means leave the text in the memo field alone and advance to the next tab in the active window, but they are trapping those keystrokes way earlier than I've been able to do inWD17...

von Scott Daughtry - am 22.03.2013 06:18
If I switch on Accept Tab in edit, I cant tab into a text memo to edit it, the control never gets focus so that option is out of the window.

If I switch off the Accept Tab in edit I can tab into and out of a text memo control so I can edit it soley with the keyboard.

However as the tab button now determines the focus a control gets, to do a tab in a text memo, I have to do ctrl+tab to add a tab space which according to MS is not SWB.
"Typing text"
"TAB Press the TAB key to move the cursor several spaces forward. You can also press the TAB key to move to the next text box on a form."

However as I use this text control in Firefox for example to write this, when I press the tab button focus moves down to the preview button and when I press CTRL Tab FF moves me onto the next open tab (webpage).

The same happens in IE as well, ie pressing the tab button in this text control moves focus to the preview button.

If I push the tab button in a Clarion text control, it moves the focus onto the next control and ctrl+tab moves the focus from 1 tab onto the next sheet controls tab it does not add a tab space.
There doesnt seem to be any way to add a tab space into a Clarion text control from what I can see, but I use txtextcontrol in Clarion for my document handling as I need to open and save to doc formats amongst other things which the RTF controls from both tools cant help me with.

So even MS break their own SWB with IE it seems!

von RichardRose - am 22.03.2013 11:16
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.