Sign in to follow this  
Followers 0
Merchants

how to extend a win?

7 posts in this topic

how to extend a win? not moveing it

$GUI = GUICreate("test123", 150, 100)

Posted Image

Share this post


Link to post
Share on other sites



Just for fun...

$hGUI = GUICreate("test123", 150, 100)
$idButton = GUICtrlCreateButton("Grow!", 25, 35, 100, 30)
GUISetState()

While 1
    Switch GUIGetMsg()
        Case -3 ; $GUI_EVENT_CLOSE
            Exit
        Case $idButton
            $aWinPos = WinGetPos($hGUI)
            WinMove($hGUI, "", $aWinPos[0], $aWinPos[1], $aWinPos[2], $aWinPos[3] + 10)
    EndSwitch
WEnd

:graduated:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Merchants,

You might also want to check out the GUIExtender UDF in my sig. :graduated:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Just for fun...

$hGUI = GUICreate("test123", 150, 100)
$idButton = GUICtrlCreateButton("Grow!", 25, 35, 100, 30)
GUISetState()

While 1
    Switch GUIGetMsg()
        Case -3 ; $GUI_EVENT_CLOSE
            Exit
        Case $idButton
            $aWinPos = WinGetPos($hGUI)
            WinMove($hGUI, "", $aWinPos[0], $aWinPos[1], $aWinPos[2], $aWinPos[3] + 10)
    EndSwitch
WEnd

:graduated:

Uhmm... Jon?

:D

Edit: Well, when I quoted the other post it was all scrambled up, now it's not. I'm so confused! :(

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

there is a problem with the controls if you extend it. the controls wil move to it must stay there

it is only 6 controls

if you press Alt+a then you can see where the extender is for

;You online ?

#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>

HotKeySet("!a","Add_text")
HotKeySet("!z","Extend")

Global $GUI[6], $Number = 0, $msg, $text[51]

$GUI[0] = GUICreate("test text?", 150, 100)
$GUI[4] = GUICtrlCreateLabel("Number of text:", 5, 5)
GUICtrlCreateLabel("message to send:", 5, 20, 90, 14)
GUICtrlCreateLabel("text:", 5, 55)
$GUI[3] = GuiCtrlCreateInput("test", 4, 35, 142, 18)
$GUI[2] = GUICtrlCreateLabel("", 0, 69, 150, 30000, 0x01)
$GUI[1] = GUICtrlCreateLabel($Number, 95, 6, 7, 11)


GUISetStyle($WS_CAPTION, $WS_BORDER)
GUISetState()

While 1
    $GUI[5] = GUIGetMsg($GUI[0])
    Select
        Case $GUI[5] = $GUI_EVENT_CLOSE
            Exit
    EndSelect
WEnd

Func Add_text()
    If $Number = 50 Then
        MsgBox(48,"Number of text","max 50 text!")
    Else
        $Number += 1
        $text[$Number] = "test"
        $msg &= $text[$Number] & @CRLF
        GUICtrlSetData($GUI[1], $Number)
        GUICtrlSetData($GUI[2], $msg)
    EndIf
EndFunc

Func Extend()
    $pos = WinGetPos($GUI[0])
    WinMove($GUI[0], "", Default, Default, $pos[2], $pos[3] + 10)
EndFunc
Edited by Merchants

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

The controls move because the have the default resizing mode. You can prevent that with GUICtrlSetResizing(), using $GUI_DOCKALL mode for individual controls. Or change the default with Opt("GUIResizeMode", $GUI_DOCKALL) before creating the controls. See help file.

:graduated:

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

thx this works

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