Sign in to follow this  
Followers 0
shornw

GUI checkbox

4 posts in this topic

This is very odd (well I think so). This script will publish a disclaimer when a user runs a program which they will have to acknowledge before the program will run. The window opens fine but the checkbox is invisible until the cursor is rolled over it, which will cause issues for users.

Can anyone offer any suggestion as to why.

#include <file.au3>
#include <process.au3>
#include <GuiConstants.au3>
#include <GUIbutton.au3>

$head = FileRead("\\pdc001\scripts\run\head.txt")
$read = FileRead("\\pdc001\scripts\run\read.txt")

GUICreate("== IMPORTANT MESSAGE ==", 450, 360)

;create checkbox
$ACCEPT = GUICtrlCreateCheckbox("ACCEPT", 200, 270)

;Create Text
GUICtrlCreateLabel("Text will go here", 10, 20, 400, 300, 0001)

;Create Buttons
$exit = GUICtrlCreateButton("Exit", 270, 320, 70, 30)
$OK = GUICtrlCreateButton("OK", 90, 320, 70, 30)

;WinActivate("** ")
GUISetState()

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Or $msg = $exit Then Exit
    If $msg = $OK Then
        _RunProg()
    EndIf
    ;   Exit
WEnd

Func _RunProg()
    If GUICtrlRead($ACCEPT) = $GUI_CHECKED Then
        Run("C:\Program Files\Internet Explorer\IEXPLORE.EXE http://google.co.uk")
        Exit
    EndIf
EndFunc   ;==>_RunProg

[font='Comic Sans MS']Eagles may soar high but weasels dont get sucked into jet engines[/font]

Share this post


Link to post
Share on other sites



The size of GUICtrlCreateLabel() was too large, it just painted over the checkbox....

#include <file.au3>
#include <process.au3>
#include <GuiConstants.au3>
#include <GUIbutton.au3>

$head = FileRead("\\pdc001\scripts\run\head.txt")
$read = FileRead("\\pdc001\scripts\run\read.txt")

GUICreate("== IMPORTANT MESSAGE ==", 450, 360)

;create checkbox
$ACCEPT = GUICtrlCreateCheckbox("ACCEPT", 200, 270)

;Create Text
GUICtrlCreateLabel("Text will go here", 10, 20, 400, 250)

;Create Buttons
$exit = GUICtrlCreateButton("Exit", 270, 320, 70, 30)
$OK = GUICtrlCreateButton("OK", 90, 320, 70, 30)

;WinActivate("** ")
GUISetState()

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Or $msg = $exit Then Exit
    If $msg = $OK Then
        _RunProg()
    EndIf
    ;   Exit
WEnd

Func _RunProg()
    If GUICtrlRead($ACCEPT) = $GUI_CHECKED Then
        Run("C:\Program Files\Internet Explorer\IEXPLORE.EXE http://google.co.uk")
        Exit
    EndIf
EndFunc   ;==>_RunProg

Share this post


Link to post
Share on other sites

How stupid do I feel :) 'cant see the wood for the trees' issue. Sorry and thank you


[font='Comic Sans MS']Eagles may soar high but weasels dont get sucked into jet engines[/font]

Share this post


Link to post
Share on other sites

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