Jump to content

Need help with Tab issue


bshoenhair
 Share

Recommended Posts

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.

Link to comment
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.

Link to comment
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!
Link to comment
Share on other sites

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!
Link to comment
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!
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...