Geoffrey Spear wrote:
Hi.
I've got a window with -dialogui => 1 set, containing a textfield with
-multiline => 1 set.
Under Windows 2000, which I was using until last week, it worked fine;
hitting Enter in the textfield moved to the next line.
This week, the machines in my office got upgraded to XP, and now
hitting Enter in the textfield does absolutely nothing.
Is that the only change that was made. I would be surprised if that was
what caused your problem. (but I am regularly surprised)
I can get to
a new line by hitting CTRL-Enter
That's the design when -dialogui is used for a multi-line textfield (or
RichEdit) control under windows. When this is the case Windows 'steals'
<ENTER> to activate the default button on the dialog, and to get an
'\r\n' sequence in the textfield you must <CTRL-ENTER>.
> Is there any way to get a fully-functional multiline textfield without
> having to give up the benefits of a dialogui?
There is a was to change this behaviour: add
-addstyle => ES_WANTRETURN,
to your Textfield constructor (ES_WANTRETURN takes the value 4096).
This allows the Textfield to 'steal' the <ENTER> back, but <ENTER> will
no longer activate the default button while the textfield has focus.
[In the next version of Win32::GUI there will be a '-wantreturn' option
for Textfields/RichEdit controls, as I've lost track of the number of
times I've seen this question on this list - I guess I should also make
it a FAQ]
Regards,
Rob.
--
Robert May
Win32::GUI, a perl extension for native Win32 applications
http://perl-win32-gui.sourceforge.net/