I have put a listbox on a userform. Sometimes I have a long text on one line and I would like to scroll horizontally if the text goes beyond the width of the control. What I would like to know is how can you allow for the horizontal scroll bar to appear on this control?
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Listbox format (2002/SP3)
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Listbox format (2002/SP3)
- This topic has 13 replies, 3 voices, and was last updated 15 years, 6 months ago.
Viewing 3 reply threadsAuthorReplies-
WSHansV
AskWoody LoungerMarch 9, 2009 at 3:37 pm #1151092I have put a listbox on a userform. Sometimes I have a long text on one line and I would like to scroll horizontally if the text goes beyond the width of the control. What I would like to know is how can you allow for the horizontal scroll bar to appear on this control?
If you set the ColumnWidths property of the list boxto a large enough number, the list box will display a horizontal scroll bar.
It’s not easy, however, to make the ColumnWidths just large enough to fit the text, since you probably use a proportional font. -
WSCFDguru
AskWoody LoungerMarch 10, 2009 at 8:30 am #1151288If you set the ColumnWidths property of the list boxto a large enough number, the list box will display a horizontal scroll bar.
It’s not easy, however, to make the ColumnWidths just large enough to fit the text, since you probably use a proportional font.Thanks Hans. Can you control the appearance of a horizontal scroll bar such that if the text fits within the current width of listbox then a scroll bar won’t show up, and if the full length of the text that appears within the listbox is beyond the width of the listbox then a horizontal scroll bar would appear? If so, how?
-
WSHansV
AskWoody Lounger -
WSCFDguru
AskWoody Lounger -
WSHansV
AskWoody LoungerMarch 10, 2009 at 12:32 pm #1151338One last question. As you can see from the attached figure, I get these dotted lines that disrupt the view in the listbox when I scroll from left to right, and back again. Any idea how I can avoid this from happening?
That’s a glitch of your video card. Make sure that you have the latest driver for your video card.
You can experiment with hardware acceleration (if you don’t have Windows Vista or later), see [post=”754457″]Post 754457[/post].
-
-
-
-
-
WSmcneilkm
AskWoody LoungerSeptember 25, 2009 at 3:17 pm #1178715Is it also possible to right justify data in a list box? I have a query populating a list box with one field shoing standard numbers. (i.e. 123,456,789 with no decimals). However it is left justified and the numbers do not lign up if they are different lengths. Can that field be formatted to display as right justified?
-
WSHansV
AskWoody Lounger -
WSmcneilkm
AskWoody Lounger -
WSHansV
AskWoody Lounger
-
-
-
-
WSmcneilkm
AskWoody Lounger -
WSmcneilkm
AskWoody Lounger -
WSHansV
AskWoody LoungerSeptember 25, 2009 at 4:13 pm #1178735List boxes in Microsoft Access do *not* have a TextAlign property. They are left-aligned by default.
You’d need Windows API functions to change that; Stephen Lebans has a sample database with the necessary code: JustiCombo.
-
WSmcneilkm
AskWoody LoungerSeptember 28, 2009 at 8:10 am #1178982List boxes in Microsoft Access do *not* have a TextAlign property. They are left-aligned by default.
You’d need Windows API functions to change that; Stephen Lebans has a sample database with the necessary code: JustiCombo.
Thanks Hans,
Its probably easier to use a continuous subform for now. I appreciate your help.
-
-
Viewing 3 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
W11 24H2 – Susan Bradley
by
G Pickerell
31 minutes ago -
7 tips to get the most out of Windows 11
by
Alex5723
27 minutes ago -
Using Office apps with non-Microsoft cloud services
by
Peter Deegan
3 hours, 57 minutes ago -
I installed Windows 11 24H2
by
Will Fastie
57 minutes ago -
NotifyIcons — Put that System tray to work!
by
Deanna McElveen
3 hours, 16 minutes ago -
Decisions to be made before moving to Windows 11
by
Susan Bradley
11 minutes ago -
Port of Seattle says ransomware breach impacts 90,000 people
by
Nibbled To Death By Ducks
11 hours, 31 minutes ago -
Looking for personal finance software with budgeting capabilities
by
cellsee6
12 hours, 53 minutes ago -
ATT/Yahoo Secure Mail Key
by
Lil88reb
1 day ago -
Devices with apps using sprotect.sys driver might stop responding
by
Alex5723
1 day, 4 hours ago -
Neowin – 20 times computers embarrassed themselves with public BSODs and goofups
by
EP
1 day, 13 hours ago -
Slow Down in Windows 10 performance after March 2025 updates ??
by
arbrich
15 hours, 24 minutes ago -
Mail from certain domains not delivered to my outlook.com address
by
pumphouse
21 hours, 32 minutes ago -
Is data that is in OneDrive also taking up space on my computer?
by
WShollis1818
1 day, 8 hours ago -
Nvidia just fixed an AMD Linux bug
by
Alex5723
2 days, 23 hours ago -
50 years and counting
by
Susan Bradley
53 seconds ago -
Fix Bluetooth Device Failed to Delete in Windows Settings
by
Drcard:))
57 minutes ago -
Licensing and pricing updates for on-premises server products coming July 2025
by
Alex5723
3 days, 10 hours ago -
Edge : Deprecating window.external.getHostEnvironmentValue()
by
Alex5723
3 days, 11 hours ago -
Rethinking Extension Data Consent: Clarity, Consistency, and Control
by
Alex5723
3 days, 11 hours ago -
OneNote and MS Word 365
by
CWBillow
3 days, 12 hours ago -
Ultimate Mac Buyers Guide 2025: Which Mac is Right For You?
by
Alex5723
3 days, 13 hours ago -
Intel Unison support ends on Windows 11 in June
by
Alex5723
3 days, 13 hours ago -
April 2025 — still issues with AMD + 24H2
by
Kevin Jones
1 day, 4 hours ago -
Windows 11 Insider Preview build 26200.5518 released to DEV
by
joep517
4 days ago -
Windows 11 Insider Preview build 26120.3671 (24H2) released to BETA
by
joep517
4 days, 1 hour ago -
Forcing(or trying to) save Local Documents to OneDrive
by
PateWilliam
4 days, 9 hours ago -
Hotpatch for Windows client now available (Enterprise)
by
Alex5723
3 days, 21 hours ago -
MS-DEFCON 2: Seven months and counting
by
Susan Bradley
2 days, 22 hours ago -
My 3 monitors go black & then the Taskbar is moved to center monitor
by
saturn2233
4 days, 18 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.