ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Question about the TextBox control (https://www.excelbanter.com/excel-programming/387656-question-about-textbox-control.html)

Tox

Question about the TextBox control
 
Windows XP SP2
Excel 2002 SP3

I have a textbox on a userform, and it gets populated with road names. I
use the vbCrLf keyword to put each road name on a new line in the textbox.
If the road name list gets too long, a vertical scrollbar is added to the
control. What I want to do is on those occasions when a scrollbar is added,
is to have the scrollbar slider positioned all the way at the top when all
is said and done. This way the first road name is always visible.

FYI, the userform isn't shown until the very end.

-gk-



NickHK

Question about the TextBox control
 
I suppose you have good reason to use a textbox to mimic a listbox....
Anyway, look into the various .Selxxx properties of the textbox.
You cannot tell (easily) when the scroll bar appears, so just set
..SelStart=0 each time you add to the textbox.

NickHK

"Tox" wrote in message
...
Windows XP SP2
Excel 2002 SP3

I have a textbox on a userform, and it gets populated with road names. I
use the vbCrLf keyword to put each road name on a new line in the textbox.
If the road name list gets too long, a vertical scrollbar is added to the
control. What I want to do is on those occasions when a scrollbar is

added,
is to have the scrollbar slider positioned all the way at the top when all
is said and done. This way the first road name is always visible.

FYI, the userform isn't shown until the very end.

-gk-






All times are GMT +1. The time now is 02:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com