Scrollbars not appearing for userform textbox

MLDeS

New Member
Joined
May 30, 2008
Messages
7
The problem:

I have a textbox and a listbox on a user form. When the user clicks on an item in the listbox the description of that item will appear in the textbox (done by VBA). When the text in the description textbox is longer than the box can display, the vertical scrollbar does not appear until the user clicks on the box to position the cursor in it.

I have set the scrollbars property of the textbox to ScrollBarsVertical, WordWrap and MultiLine to True in the VBA editor. The code that populates the box is effectively

Code:
        Form.DescriptionTextBox.Locked = False
        Form.DescriptionTextBox.Text = Description
        Form.DescriptionTextBox.ScrollBars = fmScrollBarsVertical
        Form.DescriptionTextBox.Locked = True
The line "Form.DescriptionTextBox.ScrollBars = fmScrollBarsVertical" seems to have no effect, whatever I set the scrollbars to doesn't seem to change the effect described above. I even tried setting the selection to the last part of the box contents briefly to make it scroll downwards and then setting it back to the top, and that didn't work either.

If I can't fix this behaviour of textboxes, should I be using a different control or just living with the problem?
 
Thank you MLDeS - I just had the exact same problem. Thank you for posting the solution you found! ;)
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top