Article View: comp.os.ms-windows.programmer.misc
Article #1631Re: Edit Fields in Dialog Boxes
From: Nicholas J Clayton
Date: Thu, 15 Oct 1992 20:22
Date: Thu, 15 Oct 1992 20:22
31 lines
1887 bytes
1887 bytes
In article <Bvv1Iy.8n8@world.std.com> mem@world.std.com (Jeff Lesser) writes: >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! 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'
Technical Details
Message-ID:
<Bw6J8z.21t@brunel.ac.uk>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!brunel!cs92njcReferences:
<Bvv1Iy.8n8@world.std.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!brunel!cs92njc From: cs92njc@brunel.ac.uk (Nicholas J Clayton) Newsgroups: comp.os.ms-windows.programmer.misc Subject: Re: Edit Fields in Dialog Boxes Keywords: dialogs fonts edit fields Message-ID: <Bw6J8z.21t@brunel.ac.uk> Date: 15 Oct 92 20:22:10 GMT References: <Bvv1Iy.8n8@world.std.com> Organization: Brunel University, West London, UK Lines: 31