Sign in to follow this  
Followers 0
acidfear

Opening a file

2 posts in this topic

i am working on a personal notepad. I had the open button before open a specified file taht was written in the input.

So if i type c:\windows\edit.txt

it would read the input box

read taht file and show it on the edit window

Then i started messing with options and it doesnt work anymore and i can't figure out why.

Heres my code

#include <GuiConstants.au3>


GuiCreate("AcidPad -by: AcidFear", 628, 451,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Edit_1 = GuiCtrlCreateEdit("", 10, 10, 610, 320)
$Button_2 = GuiCtrlCreateButton("Save", 20, 360, 70, 30)
$Button_3 = GuiCtrlCreateButton("Exit", 120, 360, 70, 30)
$Button_4 = GuiCtrlCreateButton("Open", 220, 360, 70, 30)

$Input_4 = GuiCtrlCreateInput("c:\documents and settings\acidfear\desktop\", 295, 365, 330, 20)
$menu = GUICtrlCreateMenu("File")
$menu_tree2=Guictrlcreatemenuitem("Open", $menu)
$menu_tree1=Guictrlcreatemenuitem("Exit", $menu)


GuiSetState()
AutoItSetOption("Trayiconhide" , 1)
While 1
    $msg = GuiGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        case $msg = $Button_3
            Exit
        case $msg = $menu_tree1
            exit
        
            
            
EndSelect
        
        
        If $msg = $button_4 then    
            GUICtrlSetData($edit_1, "")
            $doc = GUICtrlRead($Input_4)
            $doc2 = GUICtrlRead($doc)
            GUICtrlSetData($edit_1, $doc)       
            EndIf
        
        if $msg = $Button_2 Then
            $read = GUICtrlRead($Input_4)
            $read1 = guictrlread($edit_1)
            FileWriteLine($read,$read1)
        EndIf
    
        ;;;
    
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