Jump to content
Sign in to follow this  

Resize Tabs With Gui

Recommended Posts

I'm trying to get the tabs to be resized with my gui

heres my script so far

#Include <Date.au3>
#include <GuiConstants.au3>
#include <Array.au3>

$Ini = @ScriptDir & "\Data\TWP.ini"
$SavedIni = @ScriptDir & "\Saved\Test.ud"
$Title = IniRead($Ini, "Information", "Title", "")
$Author = IniRead($Ini, "Information", "Author", "")
$Version = IniRead($Ini, "Information", "Version", "")
$GuiWidth = @DesktopWidth /2
$GuiHeight = @DesktopHeight /2
$TabWidth = $GuiWidth
$TabHeight = $GuiHeight

$FNameL = IniRead($SavedIni, "UserData", "FName", "")
$LNameL = IniRead($SavedIni, "UserData", "LName", "")
$ClassL = IniRead($SavedIni, "Class", "Class", "")
$ProfL = IniRead($SavedIni, "Class", "Prof", "")
;If $DateI = "" Then $DateL = _NowDate ( )
;If $DateI <> "" Then $DateL = $DateI

;Gui Start
$Gui = GuiCreate($Title, $GuiWidth, $GuiHeight, -1, -1, BitOr($GUI_SS_DEFAULT_GUI,$WS_MAXIMIZEBOX,$WS_SIZEBOX))
$OrgPos = WinGetPos($Gui)
$Tabs = GuiCtrlCreateTab(1,1,$TabWidth, $TabHeight)

;Information Tab
GuiCtrlCreateTabItem("Information Tab")
GuiCtrlCreateLabel("First Name:", 5, 40, 55)
$FName = GuiCtrlCreateInput(" ", 65, 40, 100, 15)
GuiCtrlCreateLabel("Last Name:", 5, 65, 55)
$LName = GuiCtrlCreateInput(" ", 65, 65, 100, 15)

;Introduction Tab

;Body Tab

;Bibliography Tab

;Add Tab

;Set Data
GuiCtrlSetData($FName, $FNameL)
GuiCtrlSetData($LName, $LNameL)
;Gui End
While GuiGetMsg() <> $GUI_EVENT_CLOSE
$GuiPos = WinGetPos($Gui)
If $OrgPos[0] <> $GuiPos[0] Or $OrgPos[1] <> $GuiPos[1] Or $OrgPos[2] <> $GuiPos[2] Or $OrgPos[3] <> $GuiPos[3] Then 
    $OrgPos[0] = $GuiPos[0]
    $OrgPos[1] = $GuiPos[1]
    $OrgPos[2] = $GuiPos[2]
    $OrgPos[3] = $GuiPos[3]
    WinMove($Tabs, "", $OrgPos[0], $GuiPos[1], $GuiPos[2], $GuiPos[3])


;Testing (If you see this section please alert Acid Corps)

Func _Test($iVar)

I'm sure theres some little thing I'm doing wrong

Share this post

Link to post
Share on other sites

If you read help file, in GUICtrlCreateTab() remarks it says that "Default resizing is $GUI_DOCKSIZE." (which means "size will not change" as you can learn by searching for "$GUI_DOCKSIZE" in that very same help file)


$Tabs = GuiCtrlCreateTab(1,1,$TabWidth, $TabHeight)

GUICtrlSetResizing(-1, $GUI_DOCKAUTO) ;or other method of resizing instead of $GUI_DOCKAUTO.

Edited by Siao

"be smart, drink your wine"

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...