I am using Borland C++ 3.1 coding in C.
TIA
Jim O'Brien, CNE University of Maryland Eastern Shore
job...@mcs.umes.umd.edu Network Manager
: TIA
If I remeber correctly, this is a known bug since Windows 3.0.
Try sending an EM_SETREADONLY after creation of the Edit control.
Thomas Heller
>James M. O'Brien, Jr. (job...@mcs.umes.umd.edu) wrote:
>: I create a Edit control in the client area of my win app. One of the style
>: flags passed is ES_READONLY. The control gets created, but it appears as
>: if the readonly flag is ignored. Am I missing something obvious?
>If I remeber correctly, this is a known bug since Windows 3.0.
>Try sending an EM_SETREADONLY after creation of the Edit control.
I found EM_SETREADONLY shortly after posting... Ah well... Thanks.
This brought up another 'problem', maybe its a feature. When the
edit control is set to read only, one can not clear it until its READONLY is
set to FALSE? So to clear the edit control I've got to essentially send 5
messages? Any other way to do this?
Thanks
- Jim
>I create a Edit control in the client area of my win app. One of the style
>flags passed is ES_READONLY. The control gets created, but it appears as
>if the readonly flag is ignored. Am I missing something obvious?
>I am using Borland C++ 3.1 coding in C.
A few weeks ago I had a discussion with Michael Vincze (vin...@lobby.ti.com)
who had the same problems using BPW 7.0. It turns out that Borland implemeted
validators in their Edit objects, but accidently forgot that the control
could be read only / had to give up read only controls.
Try overriding the following messages:
WM_KEYUP, WM_KEYDOWN, WM_CHAR, WM_CUT, WM_PASTE. All responses should be:
DefWndProc(Msg)
Using this direction, you get the default (Windows) behavior. Another
direction is forgetting about the Borland object and do everything with
CreateWindow() and the EM_ messages.
--
Zweitze de Vries zwe...@et.tudelft.nl
Faculty of Electrotechnics
Delft University of Technology
Netherlands Never trust a virtual machine
You should also send the edit control a em_setReadOnly message in your
setupWindow method.
Ron.
Newsgroups: comp.os.ms-windows.programmer.controls
From: ZWE...@et.tudelft.nl (Zweitze de Vries)
Date: Fri, 22 Apr 1994 10:08:52 UNDEFINED
Organization: Faculteit der Elektrotechniek, TU Delft
In article <jobrien.38...@mcs.umes.umd.edu>
job...@mcs.umes.umd.edu (James M. O'Brien, Jr.) writes:
>I create a Edit control in the client area of my win app. One of the style
>flags passed is ES_READONLY. The control gets created, but it appears as
>if the readonly flag is ignored. Am I missing something obvious?
>I am using Borland C++ 3.1 coding in C.
A few weeks ago I had a discussion with Michael Vincze (vin...@lobby.ti.com)
who had the same problems using BPW 7.0. It turns out that Borland implemeted
validators in their Edit objects, but accidently forgot that the control
could be read only / had to give up read only controls.
Try overriding the following messages:
WM_KEYUP, WM_KEYDOWN, WM_CHAR, WM_CUT, WM_PASTE. All responses should be:
DefWndProc(Msg)
Using this direction, you get the default (Windows) behavior. Another
direction is forgetting about the Borland object and do everything with
CreateWindow() and the EM_ messages.
--
I think the guy is already using the WIndows API (Createwindow("EDIT", ...)).
I'm saying this because I had the same problem. However, the solution is quite simple (in my case worked) : Just after creating the edit control, send a message to it, saying that it is readonly. I don't have here any doc but is something like EM_READONLY.
Hope this helps
Anonio
--
------
Antonio A. V. Melo | INESC - Instituto de Engenharia de Sistemas e
Email: | Computadores (room 613)
aa...@lamparina.inesc.pt | Rua Alves Redol, 9 1000 Lisboa - Portugal