Jump to content

open notepad (radiobutton/Button)


OmarPapi
 Share

Recommended Posts

hello friend ..
I would like to activate notepad.exe with button
example: check the radio1 is click button1  = (show notepad)

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

$Form1 = GUICreate("Form1", 198, 66, 192, 124)
$Radio1 = GUICtrlCreateRadio("Notepad", 8, 8, 113, 17)
$Button1 = GUICtrlCreateButton("Open Notepad", 8, 32, 83, 25)
GUISetState(@SW_SHOW)

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

Case $Radio1
if $Button1 then
Run("notepad.exe")
EndIf
EndSwitch
WEnd

:(

Edited by OmarPapi
Link to comment
Share on other sites

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

$Form1 = GUICreate("Form1", 198, 66, 192, 124)
$Radio1 = GUICtrlCreateRadio("Notepad", 8, 8, 113, 17)
$Button1 = GUICtrlCreateButton("Open Notepad", 8, 32, 83, 25)
GUISetState(@SW_SHOW)

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

        Case $Button1
            If GUICtrlRead($Radio1) == 1 Then
                Run("notepad.exe")
            EndIf
    EndSwitch
WEnd

 

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

1 hour ago, JohnOne said:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Form1", 198, 66, 192, 124)
$Radio1 = GUICtrlCreateRadio("Notepad", 8, 8, 113, 17)
$Button1 = GUICtrlCreateButton("Open Notepad", 8, 32, 83, 25)
GUISetState(@SW_SHOW)

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

        Case $Button1
            If GUICtrlRead($Radio1) == 1 Then
                Run("notepad.exe")
            EndIf
    EndSwitch
WEnd

 

Thanks.. you can add more than one, at least 5 options (radio1,2,3,4,5)

Edited by OmarPapi
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

×
×
  • Create New...