Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable edition in a TextBox with Scrolling enabled

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

like image 237
mjsr Avatar asked Dec 28 '10 14:12

mjsr


People also ask

How do I enable scroll disabled in textarea?

the easiest way would be to use "readonly" instead. another way would be to use a fixed-height div will overflow:scroll that looks like a textarea but isn't.

How do you create a scrolling text box?

Right-click the control for which you want to set a text-scrolling option, and then click Control Properties on the shortcut menu. Click the Display tab. In the Scrolling list, click the text-scrolling option that you want.


1 Answers

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

like image 99
Michael Buen Avatar answered Oct 15 '22 22:10

Michael Buen