Board index » delphi » disabling edit box but not graying text?

disabling edit box but not graying text?

How can I disable a text box but not gray the text, have it appear as if
it was not disabled?

Thanks.

Tom.

 

Re:disabling edit box but not graying text?


Quote
tomcorc...@aol.com (TomCorcora) wrote:
>How can I disable a text box but not gray the text, have it appear as if
>it was not disabled?

I don't know, but you can always hide it, thereby revealing a label
you have cunningly placed on the same spot.

--
Best wishes

John Nurick

e-mail: j.nur...@dial.pipex.com
v-mail: <+44|0> 191 281 1306

Re:disabling edit box but not graying text?


Quote
tomcorc...@aol.com (TomCorcora) wrote:
>How can I disable a text box but not gray the text, have it appear as if
>it was not disabled?

I don't know, but you can always hide it, thereby revealing a label
you have cunningly placed on the same spot.

--
Best wishes

John Nurick

e-mail: j.nur...@dial.pipex.com
v-mail: <+44|0> 191 281 1306

Re:disabling edit box but not graying text?


On 3 Apr 1996 00:44:33 -0500, tomcorc...@aol.com (TomCorcora) wrote:

Quote
>How can I disable a text box but not gray the text, have it appear as if
>it was not disabled?

>Thanks.

>Tom.

Set ReadOnly to TRUE.

Brien King
bk...@primenet.com

Re:disabling edit box but not graying text?


In article <4jt381$...@newsbf02.news.aol.com>,
   tomcorc...@aol.com (TomCorcora) wrote:

Quote
>How can I disable a text box but not gray the text, have it appear as if
>it was not disabled?

For a moment there I thought your question was about it NOT graying the text.  I have
observed that if you disable an edit box at design time, using the object inspector, the text
remains black (at run-time too), and does not properly switch to gray.  If you disable the edit
box at run-time, the behavior is as you would expect.  This is with Delphi 1.02 on Win3.11 and
has been verified on two different development machines...

<hr><center><b>
David S. Becker  <br>
<a href="mailto:d...@plaza.ds.adp.com">
d...@plaza.ds.adp.com  </a></b><br><i>
ADP Dealer Services (Plaza R&D)  <br>
(503) 402-3236
</i></center><hr>

Re:disabling edit box but not graying text?


Look in the property sheet for the edit control.  You'll find a property
called 'ReadOnly' I think.  Set that to true and you'll have an edit box
that can't be updated at runtime but still looks like an enabled text
box.

Quote
John Nurick wrote:

> tomcorc...@aol.com (TomCorcora) wrote:
> >How can I disable a text box but not gray the text, have it appear as if
> >it was not disabled?

> I don't know, but you can always hide it, thereby revealing a label
> you have cunningly placed on the same spot.

> --
> Best wishes

> John Nurick

> e-mail: j.nur...@dial.pipex.com
> v-mail: <+44|0> 191 281 1306

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Ray Porter                                  
Applications Analyst Programmer
Administrative Data Processing
University of North Carolina at Chapel Hill
Phone: 919/966-5878       Fax: 919/962-0900
eMail: lrp.ad...@mhs.unc.edu
       dra...@email.unc.edu
Home Page: http://www.adp.unc.edu/~lrp/lrp.html

Re:disabling edit box but not graying text?


Here is a snippet from one of my applications that diables edit
controls. You can use the typesafe (I hope) VCL method "Perform" too:

API:

R := SendMessage(EditText.Handle, EM_SETREADONLY, -1, 0);

VCL:

EditText.Perform(EM_SETREADONLY, -1, 0);

To switch back to an editable control change "-1" to a "0".

Steve plotkin
Tierra Software Systems
http://ww.icanect.net/~tierra

Other Threads