Jump to content

Recommended Posts

Posted (edited)

Hi people total noob here, I made this Gui with Koda, and I want to know how i can have a menu in the top of my Gui, also how to maximize the Gui, and finally how to make the input holder to maximize to the left as the parent Gui maximizes.

Thanks in advance!!

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Form2", 976, 418, 198, 139)
$Input1 = GUICtrlCreateInput("", 232, 8, 737, 400)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO+$GUI_DOCKLEFT+$GUI_DOCKHEIGHT)
$Button1 = GUICtrlCreateButton("Button1", 72, 40, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

    EndSwitch
WEnd

 

Edited by zoel

Share this post


Link to post
Share on other sites

Basic example, look at the help file for more information:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
    Local $aWndPos
    Local $hWnd = GUICreate("Form2", 900, 420, -1, -1, Default + $WS_MAXIMIZE)
        GUISetBkColor(0x333333)
    Local $idFilemenu = GUICtrlCreateMenu("&File")
    Local $idExititem = GUICtrlCreateMenuItem("Exit", $idFilemenu)
    Local $idInput = GUICtrlCreateInput("", 210, 10, 660, 360)
        GUICtrlSetResizing(-1, $GUI_DOCKBORDERS)
    Local $idButton = GUICtrlCreateButton("Button1", 10, 10, 190, 25)
        GUICtrlSetResizing(-1, BitOR($GUI_DOCKLEFT, $GUI_DOCKTOP, $GUI_DOCKWIDTH, $GUI_DOCKHEIGHT))
    GUISetState(@SW_SHOW)
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_MAXIMIZE
;~ Uncomment lines below if you wish to have the inputbox take up the entire window
;~          $aWndPos = WinGetPos($hWnd)
;~          GUICtrlSetPos($idInput, 11, 11, $aWndPos[2] - 54, $aWndPos[3] - 99)
        Case $idExititem
            Exit
    EndSwitch
WEnd

 

Share this post


Link to post
Share on other sites

Just note:

You can create/design main/context/tray menu visually directly in Koda and it will generate AU3 code for you.

Just place appropriate menu icon (from Koda's toolbar) on the form and doubleclick on it to populate visual menu editor.

In Koda helpfile see section: Property editors/Menu builder

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

×
×
  • Create New...