Jump to content

GUI problems


Newbi3
 Share

Recommended Posts

#include <GuiConstantsEx.au3>
#include <IE.au3>



MainGui()

Func MainGui()

    Local $Run, $Website, $msg
    GUICreate("Short Cuts")
    Opt("GUICoordMode", 2)
    $Run = GUICtrlCreateButton("Run Somthing", 0, 0, 100)
    $Website = GUICtrlCreateButton("Go to a website", 0, -1)

    GUISetState()

    While 1
        
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
            Case $msg = $Run
                GUICreate("Run what program?", 400, 50)
                GUISetState(@SW_SHOW)
                GuiCtrlCreateInput("Type name here", 200, 250)
                GuiCtrlCreatecombo("Sample Combo", 250, 80, 120, 100)
                GuiCtrlCreateButton("Sample Button", 0, 0, -1)
    While 1
        $msg = GUIGetMsg()
        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
                
                
            Case $msg = $Website
                $program = InputBox ("Which website?", "Type website name here")
                
                $oIE = _IECreate ($program)
            
                
            
        EndSelect
    WEnd
EndFunc

I don't know why this program does not work. It should, right? The problem is the buttons on the second GUI ($run), don't show up. Please help me! Sorry for bad organizing, im new :mellow: Thanks to ANYONE who helps in advance :(

Edited by Newbi3
Link to comment
Share on other sites

#include <GuiConstantsEx.au3>
#include <IE.au3>



MainGui()

Func MainGui()

 Local $Run, $Website, $msg
 GUICreate("Short Cuts")
 Opt("GUICoordMode", 2)
 $Run = GUICtrlCreateButton("Run Somthing", 0, 0, 100)
 $Website = GUICtrlCreateButton("Go to a website", 0, -1)

 GUISetState()

 While 1
        
 $msg = GUIGetMsg()
 Select
 Case $msg = $GUI_EVENT_CLOSE
 ExitLoop
 Case $msg = $Run
                GUICreate("Run what program?", 400, 50)
                GUISetState(@SW_SHOW)
                GuiCtrlCreateInput("Type name here", 200, 250)
                GuiCtrlCreatecombo("Sample Combo", 250, 80, 120, 100)
                GuiCtrlCreateButton("Sample Button", 0, 0, -1)
    While 1
 $msg = GUIGetMsg()
 If $msg = $GUI_EVENT_CLOSE Then ExitLoop
 WEnd
                
                
            Case $msg = $Website
 $program = InputBox ("Which website?", "Type website name here")
                
                $oIE = _IECreate ($program)
            
                
            
 EndSelect
 WEnd
EndFunc

I don't know why this program does not work. It should, right? The problem is the buttons on the second GUI ($run), don't show up. Please help me! Sorry for bad organizing, im new :mellow: Thanks to ANYONE who helps in advance :(

I find your use of GuiCoordMode is as confusing as hell :lol:. You have specified that the controls you can't see are outside of the gui you created.

Here is a quick change, but using a standard coordinate mode.

#include <GuiConstantsEx.au3>
#include <IE.au3>



MainGui()

Func MainGui()

    Local $Run, $Website, $msg
    GUICreate("Short Cuts", 500, 500)
    ;Opt("GUICoordMode", 2)
    $Run = GUICtrlCreateButton("Run Somthing", 0, 0, 100)
    $Website = GUICtrlCreateButton("Go to a website", 120, 0)

    GUISetState()

    While 1

    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
    ExitLoop
    Case $msg = $Run
    $hRun = GUICreate("Run what program?", 400, 250)
    GUISetState(@SW_SHOW)
    GUICtrlCreateInput("Type name here", 20, 20)
    GUICtrlCreateCombo("Sample Combo", 20, 40, 120, 100)
    GUICtrlCreateButton("Sample Button", 20, 100)
    While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
    GUIDelete($hRun)

    Case $msg = $Website
    $program = InputBox("Which website?", "Type website name here")

    $oIE = _IECreate($program)



    EndSelect
    WEnd
EndFunc ;==>MainGui
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
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...