Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Edit Fields in Dialog Boxes

0 views
Skip to first unread message

Jeff Lesser

unread,
Oct 9, 1992, 11:25:44 AM10/9/92
to
We have a set of Windows 2.11 applications that we've 98% ported to
Windows 3.1. We've cleaned up the ugliness in most of our 150 dialog
boxes, but have just discovered that many edit fields were set to fixed
widths in order to restrict the number of input characters. Now, with the
proportional font, the user can in some cases (lower case) enter a lot
more characters than we can handle, and in other cases (upper case), fewer
characters than the real limit.

Is there a simple way, WITHOUT recoding all 150 dialog boxes, of having
Windows use a fixed-pitch font in edit fields, or in some other way
reinstate the character limits we had under Windows 2.11?

Thanks very much for any responses!

Scott Harper

unread,
Oct 9, 1992, 3:16:54 PM10/9/92
to
Jeff Lesser (m...@world.std.com) wrote:
: Is there a simple way, WITHOUT recoding all 150 dialog boxes, of having

: Windows use a fixed-pitch font in edit fields, or in some other way
: reinstate the character limits we had under Windows 2.11?

Take a look at the EM_LIMITTEXT message... Put it in your WM_INITDIALOG
case.
--
Scott Harper Optical Data Systems, Inc.
sc...@ods.com 1101 E. Arapaho Road
(214) 234-6400 Richardson, TX 75081

Nicholas J Clayton

unread,
Oct 15, 1992, 4:22:10 PM10/15/92
to

You can certainly limit the number of characters that can be typed into the
edit child control. In the dialog create code, try the following,

SendDlgItemMessage(hWndDlg, ID_CONTROL, EM_LIMITLENGTH, 0, x);

If I've done that properly (from memory), hWndDlg is the handle to the dialog,
ID_CONTROL is the edit control ID, EM_LIMITLENGTH limits the length (B-) ),
wParam is 0, and lParam is the length.

I could have that the wrong way round (lParam and wParam), so check the
docs/.hlp anyway. You might want to check some of the other EM_ messages as
well, since they are all pretty helpful.

Rgds, Nik

... `My Worf, open hailing frequencies' `Aye sir, phasers locked'

0 new messages