Sign in to follow this  
Followers 0
Danger111

Making Notepad (Save/Open) problem

2 posts in this topic

ok i have problem (Save/Open) problem to make little notepad

ok first open koda FromDesigner

Posted Image

now i must insert some details to make notepad it will look like this

Posted Image

with codes it will look like this

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Test Notepad", 633, 447, 193, 115)
GUICtrlCreateEdit("", 0, 0, 617, 417)
$MenuItem3 = GUICtrlCreateMenu("File")
$MenuItem1 = GUICtrlCreateMenuItem("Open", $MenuItem3)
$MenuItem4 = GUICtrlCreateMenuItem("Save", $MenuItem3)
$MenuItem5 = GUICtrlCreateMenuItem("Exit", $MenuItem3)
$MenuItem2 = GUICtrlCreateMenu("Notepad")
$MenuItem6 = GUICtrlCreateMenuItem("About", $MenuItem2)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
                
    EndSwitch
WEnd

now i must make changes (cases)

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Test Notepad", 633, 447, 193, 115)
GUICtrlCreateEdit("", 0, 0, 617, 417)
$MenuItem3 = GUICtrlCreateMenu("File")
$MenuItem1 = GUICtrlCreateMenuItem("Open", $MenuItem3)
$MenuItem4 = GUICtrlCreateMenuItem("Save", $MenuItem3)
$MenuItem5 = GUICtrlCreateMenuItem("Exit", $MenuItem3)
$MenuItem2 = GUICtrlCreateMenu("Notepad")
$MenuItem6 = GUICtrlCreateMenuItem("About", $MenuItem2)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
            
        case $MenuItem6
            MsgBox(0, "About", "It is just a Test Notepad")
            
        case $MenuItem5
            WinClose("Test Notepad")
            
        case $MenuItem4
            $file = FilesaveDialog("Choose file...",@TempDir,"All (*.*)")
            If @error <> 1 Then GuiCtrlCreateMenuItem ($file,$recentfilesmenu)
            
        case $MenuItem1
            $file = FileOpenDialog("Choose file...",@TempDir,"All (*.*)")
            If @error <> 1 Then GuiCtrlCreateMenuItem ($file,$recentfilesmenu)

    EndSwitch
WEnd

but with this cases i can not save or open any txt file when you click on it it will be open only windows but it don't saves please help

case $MenuItem4
            $file = FilesaveDialog("Choose file...",@TempDir,"All (*.*)")
            If @error <> 1 Then GuiCtrlCreateMenuItem ($file,$recentfilesmenu)
            
        case $MenuItem1
            $file = FileOpenDialog("Choose file...",@TempDir,"All (*.*)")
            If @error <> 1 Then GuiCtrlCreateMenuItem ($file,$recentfilesmenu)

Share this post


Link to post
Share on other sites



FilesaveDialog and FileOpenDialog only returns the path chosen, you then need to do the code to do the opening/saving with that path.


GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF.

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