Start Free Trial
Come for the solution, stay for everything else.
Start Free Trial
changing VB textbox's tabwidth
in VB, by default, the tab width is 8 characters. how can i change that to 4 characters?
Visual Basic Classic
8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Log in or sign up to see answer
Become an EE member today
7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
your answer is not exactly what i wanted... then after scanning EE further, found the solution at
manage to adapt that solution to mine, so i added the following codes :
Private Declare Function SendMessageArray Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const EM_SETTABSTOPS = &HCB
' Set new tab stops (in dialog units)
' Note: Default tabs stops are every 32 dialog units
Sub SetTabStops(txtb As TextBox)
Const cMAX = 20
Const cSIZE = 16
If txtb Is Nothing Then Exit Sub
' Can't seem to pass the ParamArray to SendMessage, so copy it to array of long
ReDim a(cMAX) As Long
Dim t As Long
Dim tabcount As Long
tabcount = cMAX + 1
For t = 0 To cMAX
a(t) = (t) * cSIZE
'Clear any existing tabs.
, EM_SETTABSTOPS, 0&, 0&)
'Set the tabs.
, EM_SETTABSTOPS, tabcount, a(0))
since i can't award the points to nazdor (the original poster) and i also can't award the points to myself :)
so i'll award them to you.
thanks for your effort.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
Plans and Pricing
Certified Expert Program
© 1996-2023 Experts Exchange, LLC. All rights reserved. Covered by US Patent