Jump to content

Making Notepad (Save/Open) problem


Recommended Posts

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)
Link to comment
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.
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...