One way to do that is making this
textbox
readonly
.
another way to do is to add "
onkeypress="return false
" attribute in your control:
<asp:TextBox ID="TextBox2" onkeypress="return false" runat="server"></asp:TextBox>
NOTE: This is only useful for asp.net. if it is a winform use the first method.