Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add scrollbars in c# form

Tags:

c#

scroll

textbox

For some reason only adding a vertical scroll bar works with my code.

I can't seem to add BOTH a vertical and horizontal scroll bar.

private void textBox1_TextChanged(object sender, EventArgs e)
{
    textBox1.ScrollBars = ScrollBars.Vertical;     
}
like image 725
user2788405 Avatar asked Sep 25 '13 17:09

user2788405


1 Answers

you don't need to write a code for this. Just change the properties of textBox. For both scroll bars, if Multiline set to True, then set ScrollBars to Both and set WordWrap to False in properties. No need for writing code at all since this is for WinForms.

like image 166
Mlarnt90 Avatar answered Sep 23 '22 10:09

Mlarnt90