Jump to content
Sign in to follow this  
Manjish

_GUICtrlTab_SetItemSize not working as it should

Recommended Posts

Manjish

Hi I wanted to create vertical tabs and set the width and height for the tab items. But for some reason no matter what width I set, it shows the same width. Dunno what's causing this..

Also I am not able to see the text on my tabs as well.. again dunno why

#include <GUIConstantsEx.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <GuiTab.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 1024, 700, 0,0)
$hTab1 = GUICtrlCreateTab(150, 8, 700, 550, $TCS_VERTICAL)
_GUICtrlTab_SetItemSize($hTab1,50,100)
$tab0 = GUICtrlCreateTabItem("Configure")
$tab2=GUICtrlCreateTabItem("Configure Globals")
$tab3=GUICtrlCreateTabItem("Configure Globals")
$tab4=GUICtrlCreateTabItem("Configure Globals")
$tab5=GUICtrlCreateTabItem("Configure Globals")

GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd
Edited by Manjish

[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com

Share this post


Link to post
Share on other sites
Mecrazycoder

Hi I wanted to create vertical tabs and set the width and height for the tab items. But for some reason no matter what width I set, it shows the same width. Dunno what's causing this..

Also I am not able to see the text on my tabs as well.. again dunno why

#include <GUIConstantsEx.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <GuiTab.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 1024, 700, 0,0)
$hTab1 = GUICtrlCreateTab(150, 8, 700, 550, $TCS_VERTICAL)
_GUICtrlTab_SetItemSize($hTab1,50,100)
$tab0 = GUICtrlCreateTabItem("Configure")
$tab2=GUICtrlCreateTabItem("Configure Globals")
$tab3=GUICtrlCreateTabItem("Configure Globals")
$tab4=GUICtrlCreateTabItem("Configure Globals")
$tab5=GUICtrlCreateTabItem("Configure Globals")

GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

I am not 100% sure but add GUISetState() after _GUICtrlTab_SetItemSize($hTab1,50,100).

Note: I haven't see the code completely. I think GUISetState() not needed

Edited by Mecrazycoder

[size="4"][font="Arial Narrow"][font="Garamond"]Attitude is a little thing that makes a big difference[/font][/font][/size][indent][/indent]

Share this post


Link to post
Share on other sites
99ojo

Hi I wanted to create vertical tabs and set the width and height for the tab items. But for some reason no matter what width I set, it shows the same width. Dunno what's causing this..

Also I am not able to see the text on my tabs as well.. again dunno why

#include <GUIConstantsEx.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <GuiTab.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 1024, 700, 0,0)
$hTab1 = GUICtrlCreateTab(150, 8, 700, 550, $TCS_VERTICAL)
_GUICtrlTab_SetItemSize($hTab1,50,100)
$tab0 = GUICtrlCreateTabItem("Configure")
$tab2=GUICtrlCreateTabItem("Configure Globals")
$tab3=GUICtrlCreateTabItem("Configure Globals")
$tab4=GUICtrlCreateTabItem("Configure Globals")
$tab5=GUICtrlCreateTabItem("Configure Globals")

GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Hi,

your code works fine for me!

_GUICtrlTab_SetItemSize($hTab1,50,100) -> This changes the width and height of the TabItems.

You may have Large Fonts in your display Settings chosen?

Display Properties -> Advanced -> in General Tab Font Size?

;-))

Stefan

Share this post


Link to post
Share on other sites
Manjish

@Stefan

See if u put _GUICtrlTab_SetItemSize($hTab1,50,100) or _GUICtrlTab_SetItemSize($hTab1,5,100), it shows the same width. I dunno why. That's what I mean.

@mecrazy

Nopes not working. GuiCtrlSetState() isn't making any difference at all. I don't see why it shud anyways


[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com

Share this post


Link to post
Share on other sites
Mecrazycoder

@Stefan

See if u put _GUICtrlTab_SetItemSize($hTab1,50,100) or _GUICtrlTab_SetItemSize($hTab1,5,100), it shows the same width. I dunno why. That's what I mean.

@mecrazy

Nopes not working. GuiCtrlSetState() isn't making any difference at all. I don't see why it shud anyways

Try this

#include <GUIConstantsEx.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <GuiTab.au3>
#Region ### START Koda GUI section ### Form=

GUICreate("Form1", 1024, 700, 0,0)

Dim $hTab1 = GUICtrlCreateTab(150, 8, 600, 550, BitOR($TCS_VERTICAL, $TCS_FIXEDWIDTH))

$a=_GUICtrlTab_SetItemSize($hTab1,20,100)


$tab0 = GUICtrlCreateTabItem("Configure")
$tab2=GUICtrlCreateTabItem("Configure Globals")
$tab3=GUICtrlCreateTabItem("Configure Globals")
$tab4=GUICtrlCreateTabItem("Configure Globals")
$tab5=GUICtrlCreateTabItem("Configure Globals")


GUISetState(@SW_SHOW)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)

#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

[size="4"][font="Arial Narrow"][font="Garamond"]Attitude is a little thing that makes a big difference[/font][/font][/size][indent][/indent]

Share this post


Link to post
Share on other sites
Manjish

Hi mecrazy..

Thanks this works just the way I want it to.

Now, I am trying to figure out that why I can't see any text on my tabs when I increase the width.

#include <GUIConstantsEx.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <GuiTab.au3>
#Region ### START Koda GUI section ### Form=

GUICreate("Form1", 1024, 700, 0,0)

Dim $hTab1 = GUICtrlCreateTab(150, 8, 600, 550, BitOR($TCS_VERTICAL, $TCS_FIXEDWIDTH))

$a=_GUICtrlTab_SetItemSize($hTab1,150,100)


$tab0 = GUICtrlCreateTabItem("Confi")
$tab2=GUICtrlCreateTabItem("Config")


GUISetState(@SW_SHOW)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)

#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Anybody has any idea?


[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com

Share this post


Link to post
Share on other sites
Mecrazycoder

Hi mecrazy..

Thanks this works just the way I want it to.

Now, I am trying to figure out that why I can't see any text on my tabs when I increase the width.

#include <GUIConstantsEx.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <GuiTab.au3>
#Region ### START Koda GUI section ### Form=

GUICreate("Form1", 1024, 700, 0,0)

Dim $hTab1 = GUICtrlCreateTab(150, 8, 600, 550, BitOR($TCS_VERTICAL, $TCS_FIXEDWIDTH))

$a=_GUICtrlTab_SetItemSize($hTab1,150,100)


$tab0 = GUICtrlCreateTabItem("Confi")
$tab2=GUICtrlCreateTabItem("Config")


GUISetState(@SW_SHOW)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)

#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Anybody has any idea?

I can able to see the text even after increasing the width.Can you be more specific?

[size="4"][font="Arial Narrow"][font="Garamond"]Attitude is a little thing that makes a big difference[/font][/font][/size][indent][/indent]

Share this post


Link to post
Share on other sites
Manjish

Can u see the text in the script I have put in my prev post.. Coz I can't


[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com

Share this post


Link to post
Share on other sites
Mecrazycoder

Can u see the text in the script I have put in my prev post.. Coz I can't

Do you mean Confi or Config? If yes, then I can able to see it.

[size="4"][font="Arial Narrow"][font="Garamond"]Attitude is a little thing that makes a big difference[/font][/font][/size][indent][/indent]

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  

×