I am writing a GUI application with multiple tabs. These tabs will be added dynamically at run time, from an ini
file.
I can’t find a way to adjust the tab control width to fit the actual tabs.
Here is a sample:
Opt('GUIOnEventMode', 1) ; use events instead of loop
AutoitSetOption('ExpandVarStrings',1) ; enable ' … $var$ … '
Global $gui
$gui = GUICreate('Test', 200, 160)
GUISetOnEvent(-3, 'quit') ; quit on close
Local $tabControl = GUICtrlCreateTab(10, 10)
Local $hello = GUICtrlCreateTabItem('Hello')
Local $goodbye = GUICtrlCreateTabItem('Goodbye')
Local $goodbye = GUICtrlCreateTabItem('Blah Blah')
Local $goodbye = GUICtrlCreateTabItem('Etc')
Func quit()
GUIDelete($gui)
Exit
EndFunc
GUISetState(@SW_SHOW,$gui)
While 1
Sleep(1)
WEnd
GUIDelete($gui)
I end up with something ike this:
I can set the dimensions of the tab control with the GUICtrlCreateTab
function, but, once I add the varying controls, the width will be wrong.
Is there a way either of getting the width of the individual tab labels or of the whole tab bar to adjust the tab control. I can then adjust the window size as well.