Ralt
Ralt

Reputation: 2124

Dynamic TextBox scrollbar

I'm trying to add a verticle scroll bar to my dynamic Textbox.

Here is the code

TextBox spellText = new TextBox()   { Multiline = true, ScrollBars.Vertical };

I get the error:

Invalid initializer member declarator

ScrollBars.Verticle = True also does not work.

Upvotes: 1

Views: 1072

Answers (1)

LarsTech
LarsTech

Reputation: 81610

Assuming WinForms, the declaration isn't quite right. Try this:

TextBox spellText = new TextBox() { Multiline = true,
                                    ScrollBars = ScrollBars.Vertical };

Upvotes: 2

Related Questions