Re: How to prevent SELECTION by user, in TEXTBOX ?

Tech-Archive recommends: Fix windows errors by optimizing your registry




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@xxxxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxx> wrote in message
news:g492me$ejn$1@xxxxxxxxxxxxxxxxxxxxxxxxx
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.





.



Relevant Pages

  • RE: GridView with Password Field
    ... As for the TextBox in template field, if you use "Bind" expression and ... it automatically provide two-way databinding function. ... Are you using custom code to do the database updating(so that you need to ... manually get reference to the data in textbox)? ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • ASP.NET textbox loses text value in composite control but Textbox subclass doesnt!?
    ... I ran into some strange behavior regarding the ASP.NET TextBox control ... used in a custom composite control. ... listing 2) my ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • RE: How to get back to default style of a control after customizin
    ... standard behavior - by using ControlStyles.UserPaint, I have somehow lost ... When my Enabled custom drawn textbox is first displayed with text in it, ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: Forcing the dotted rectangle on a button?
    ... When you say "custom button" are you certain that this control follows the ... Find great Windows Forms articles in Windows Forms Tips and Tricks ... > button to show highlight is to Tab into it. ... > the textbox and press the Tab key, the 2nd button gets that dotted line, ...
    (microsoft.public.dotnet.languages.csharp)
  • DataGrid Key Processing Comes Unhinged
    ... I'm trying to implement a "floating textbox" in a datagrid and seeing ... In my override for DataGridTextBoxColumn.Edit, ... The problem comes when I'm done editing with the custom text box. ...
    (microsoft.public.dotnet.languages.vb)