From: tony on
Hi,

I want to prevent the user, from selecting text (blue selection) in TextBox
, How can i do this ?

(the textbox must be enabled=true)
Thanking in advance.


From: "Paul G. Tobey [eMVP]" p space tobey no spam AT no instrument no spam DOT on
Why must it be enabled, but not selectable? Tell us *what* you are trying
to do, *not* how you've decided to do it. We can give you a good answer
that way.

Paul T.

"tony" <daylor(a)netvision.net.il> wrote in message
news:g492me$ejn$1(a)news4.netvision.net.il...
> Hi,
>
> I want to prevent the user, from selecting text (blue selection) in
> TextBox , How can i do this ?
>
> (the textbox must be enabled=true)
> Thanking in advance.
>


From: Simon Hart [MVP] on
This sounds quite ugly. But if you'd really need to do it, you'd have to
implement the OnMouseUp event check the selected text and set it to zero if
its greater than 0 - ugly but will work.
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


"tony" wrote:

> Hi,
>
> I want to prevent the user, from selecting text (blue selection) in TextBox
> , How can i do this ?
>
> (the textbox must be enabled=true)
> Thanking in advance.
>
>
>
From: tony on

Hi,

The problem is I created custom textbox ,
I want to prevent the user to change the text.

For some reason the Text.ReadOnly did not prevent the user to write text in
the TextBox,
so i create custom read only that will return immedialy from Key events.

till here everything was O.K

but then, i notice that if i select the text and then write somthing, the
text is changed, although i had the custom readonly=true.

Thanking in advance,


"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:%23Rel6hs2IHA.548(a)TK2MSFTNGP06.phx.gbl...
> Why must it be enabled, but not selectable? Tell us *what* you are trying
> to do, *not* how you've decided to do it. We can give you a good answer
> that way.
>
> Paul T.
>
> "tony" <daylor(a)netvision.net.il> wrote in message
> news:g492me$ejn$1(a)news4.netvision.net.il...
>> Hi,
>>
>> I want to prevent the user, from selecting text (blue selection) in
>> TextBox , How can i do this ?
>>
>> (the textbox must be enabled=true)
>> Thanking in advance.
>>
>
>


From: "Paul G. Tobey [eMVP]" p space tobey no spam AT no instrument no spam DOT on
So, the problem is that ReadOnly isn't working, NOT THAT YOU NEED TO PREVENT
SELECTION OF TEXT! Give us the details on your environment. You haven't
told us what the target device is (Windows Mobile? Windows CE? Version?),
what version of .NET Compact Framework you are working with, etc. It might
be worthwhile to build a simple custom textbox that demonstrates the
problem, verify that it exists in that case, and post the code. Can we
presume, also, that regular Textbox controls *do* work correctly with
respect to ReadOnly for you? I can't find any situations where ReadOnly
doesn't work.

Paul T.

"tony" <daylor(a)netvision.net.il> wrote in message
news:g4cqfs$sr8$1(a)news4.netvision.net.il...
>
> Hi,
>
> The problem is I created custom textbox ,
> I want to prevent the user to change the text.
>
> For some reason the Text.ReadOnly did not prevent the user to write text
> in the TextBox,
> so i create custom read only that will return immedialy from Key events.
>
> till here everything was O.K
>
> but then, i notice that if i select the text and then write somthing, the
> text is changed, although i had the custom readonly=true.
>
> Thanking in advance,
>
>
> "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
> com> wrote in message news:%23Rel6hs2IHA.548(a)TK2MSFTNGP06.phx.gbl...
>> Why must it be enabled, but not selectable? Tell us *what* you are
>> trying to do, *not* how you've decided to do it. We can give you a good
>> answer that way.
>>
>> Paul T.
>>
>> "tony" <daylor(a)netvision.net.il> wrote in message
>> news:g492me$ejn$1(a)news4.netvision.net.il...
>>> Hi,
>>>
>>> I want to prevent the user, from selecting text (blue selection) in
>>> TextBox , How can i do this ?
>>>
>>> (the textbox must be enabled=true)
>>> Thanking in advance.
>>>
>>
>>
>
>