Sign in to follow this  
Followers 0
bshoenhair

Need help with Tab issue

9 posts in this topic

I have a Tab control with 2 tabs and I want the 2 tabs to fill the entire width of the tab control.

My interpretation of the help file it says to use:

$TCS_RIGHTJUSTIFY+TCS_MULTILINE

Description For TCS_RIGHTJUSTIFY:

The width of each tab is increased, if necessary, so that each row of tabs fills the entire width of the tab control.

This window style is ignored unless the TCS_MULTILINE style is also specified.

I must be missing something here because it does not work the tabs remain the same size.

Share this post


Link to post
Share on other sites



I tried this once. It wasn't terribly easy. If I remember, I had to manually send messages to the tab control to set the height/width of each tab control myself. I don't remember what message that was off the top of my head, though.

Share this post


Link to post
Share on other sites

Couldn't you just pad the tabitem titles with spaces?

GuiCreate("Example")
GuiCtrlCreateTab(10, 10, 200, 200)
GuiCtrlcReateTabItem("           One          ")
GuiCtrlcReateTabItem("           Two          ")

GuiSetState()
While guiGetMsg() <> -3
WEnd

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Getting closer: But I can only change the height....

EDIT: Added the FIXEDWIDTH style

Global $TCS_FIXEDWIDTH = 0x400
Global $TCM_FIRST = 0x1300;
Global $TCM_SETITEMSIZE = ($TCM_FIRST + 41);

GuiCreate("Example")
   $tab = GuiCtrlCreateTab(10, 10, 204, 200, $TCS_FIXEDWIDTH)
   GuiCtrlCreateTabItem("One")
   GuiCtrlCreateTabItem("Two")
   GuiSendMsg($tab, $TCM_SETITEMSIZE, 0, _MakeLong(100, 40));(width, height)
GuiSetState()

While guiGetMsg() <> -3
WEnd

; From Valik's post 
; http://www.autoitscript.com/forum/index.php?act=ST&f=7&t=5620&hl=&view=findpost&p=37511
Func _MakeLong($l, $h)
   Return BitOR(BitAnd($l, 0xFFFF), BitShift(BitAnd($h, 0xFFFF), -16))
EndFunc; _MakeLong()
Edited by CyberSlug

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

CS, I think there is a minimum size but no maximum. Trying setting some absurdly large height and see if the size increases. I could be wrong, though, I don't fully remember what all I tested.

Share this post


Link to post
Share on other sites

Maybe TCS_FIXEDWIDTH?

Share this post


Link to post
Share on other sites

Maybe TCS_FIXEDWIDTH?

<{POST_SNAPBACK}>

That's it :)

$TCS_FIXEDWIDTH = 0x400

$tab = GuiCtrlCreateTab(10, 10, 200, 200, $TCS_FIXEDWIDTH)

;....

GuiSendMsg($tab, $TCM_SETITEMSIZE, 0, _MakeLong($width, $height))

;....


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

Great, got it to work, thanks for the help

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0