visual basic question

Thread Starter

CaliusOptimus

Joined Aug 14, 2005
59
im new to VB, so im just getting the hang of things. i havent been able to find a straight forward answer to my question on msdn or google, so thats why im here. ive been trying to change the value of txtBox.Size.Width (where txtBox is a toolstriptextbox) after a simple event such as a button click. ive tried things like:

txtBox.Size.Width = 200

or

txtBox.Size.Width(integervariable)

and i just get an error message. any one here have any suggestions?

EDIT: i solved the problem, the width value must be accessed outside of the size attribute ie:

txtBox.Width = 200
 

jpitz31

Joined Oct 24, 2007
39
I found this out on the web.

By default scrolling is disabled in text boxes and multiline is set to
false. As such, the text box will only ever be 1 line. However if you
enable scrolling and set multiline to true, you can calculate the size you
will need to make the text box by fixing the font (type and size) and then
calculating the box dimensions based on the string length. If you use the
text changed event to do the calculation, the user will experience the box
growing as they are typing.

Thanks

Joe
 
Top