To make characters in the text of TextBox ReadOnly.

Hi All !!

I am new to VB.NET... I want to make the characters in the text of TextBox control read only... That is, to make those characters should not be replaced by any other character, or can not be editable... So is there any property or method that can be implemented to the charactres/text(string) of textbox's text ?

Responses are welcome

Thanks,

Prodigy201

[457 byte] By [Prodigy201] at [2007-12-23]
# 1
Set ReadOnly property to True.
Back-color will changed automatically to gray, so you can change it back to white by changing Backcolor property.
HTH.
MoayadMardini at 2007-8-30 > top of Msdn Tech,Visual Basic,Visual Basic Language...
# 2

Hi !!

Thanks for the response... :) . Really appreciate !!

But I don't want to make the whole Textbox uneditable. I just want some part of input and moreover already set text in the textbox uneditable, as we can see as par as in MaskedTextBox, for e.g. in date format, we have "/" separator uneditable. So I just want to make the text uneditable.

Expecting the responses.

Thanks,

Prodigy201

Prodigy201 at 2007-8-30 > top of Msdn Tech,Visual Basic,Visual Basic Language...
# 3

I came across a similar need with a text box. I used the keyPress event to ignore any keystrokes that I didn't want. To keep the format on the text box I used the textChanged event.

Just some suggestions.

Johnny

JohnLieurance at 2007-8-30 > top of Msdn Tech,Visual Basic,Visual Basic Language...