Sign in to follow this  
Followers 0
unknown12

Button

2 posts in this topic

Ok, i made this simple script for taking notes. But when i press the Save Notes button it saves to the file, but closes the program. Anyway to stop this?

; Script generated by AutoBuilder 0.5 Prototype

#include <GuiConstants.au3>

If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000

GuiCreate("NoteTaker", 552, 359,(@DesktopWidth-552)/2, (@DesktopHeight-359)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$file = FileOpen ( "Notes.txt","0")
$notes_file = FileRead($file,"999999")

$Edit_1 = GuiCtrlCreateEdit($notes_file, 10, 10, 530, 310)
$Button_2 = GuiCtrlCreateButton("Save Notes", 10, 320, 530, 30)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
    Case $msg = $Button_2
        $file1 = FileOpen ( "Notes.txt","2")
        $contents = GuiCtrlRead($Edit_1)
        $notes_file = FileWrite($file1,$contents)   
        ExitLoop
    Case Else
    ;;;
    EndSelect
WEnd
Exit

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