Reputation: 7590
i would like to know if it is possible to disable the edition of a textbox without losing the scrolling capability. If the Enabled property is set to false then the scroll bars are also disabled
Upvotes: 9
Views: 16595
Reputation: 1
Is easy to do that you just must to
// set readonly property true
ReadOnly = True;
// set cursor property to default
Cursor = Default;
// change focus when it has on enter event
private void textBox4_Enter(object sender, EventArgs e)
{
label8.Focus();
}
Upvotes: 0
Reputation: 39393
Try:
textBox1.ReadOnly = true;
Disable text selection:
ContextMenu blankContextMenu = new ContextMenu();
textBox1.ContextMenu = blankContextMenu;
For disabling Ctrl+C and Ctrl+V, capture them on KeyDown event
Upvotes: 24