Sign in to follow this  
Followers 0
Hello Me You

FileOpenDialog is not working

3 posts in this topic

#1 ·  Posted (edited)

I've got a problem with the FileOpenDialog, when I click on the "Öffnen"-Button, nothing happens. This is the script:

#include <GUIConstants.au3>
GUICreate("Mein erstes Testprogramm", 400, 400)
GUISetIcon(@SystemDir & "\calc.exe", 0)


$menu1 = GuiCtrlCreateMenu("&Datei")
$menu2 = GuiCtrlCreateMenu("B&earbeiten")
$menu3 = GuiCtrlCreateMenu("Hilfe")

$item1 = GUICtrlCreateMenuItem("Beenden", $menu1)
$item2 = GUICtrlCreateMenuItem("Einfügen", $menu2)
$item3 = GUICtrlCreateMenuItem("Info", $menu3)
$item4 = GUICtrlCreateMenuItem("Öffnen", $menu1)
GUISetState()

While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE then 
    $answer = MsgBox(4096 + 36, "Programm wird beendet", "Möchten Sie das Programm wirklich beenden?")
    If $answer = 6 Then
        ExitLoop
    Endif
    If $answer = 7 Then
    Endif
Endif


If $msg = $item3 Then
    MsgBox(0,"Info", "Copyright 2006 by me")
Endif

If $msg = $item1 then
    $answer = MsgBox(4096 + 36, "Programm wird beendet", "Möchten Sie das Programm wirklich beenden?")
    If $answer = 6 Then
        ExitLoop
        EndIf
    If $answer = 7 Then
        EndIf

If  $msg = $item4 Then
$file = FileOpenDialog("Wählen Sie die Datei...",@TempDir,"Alle (*.*)")
            If @error <> 1 Then GuiCtrlCreateMenuItem ($file,$recentfilesmenu)
        
Endif
Endif
Wend
Edited by Hello Me You

Random

Share this post


Link to post
Share on other sites



HI,

check you If statements you never reach to item4. :lmao:

You'll see it better when using Select or switch statement instead of If the else.

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

HI,

check you If statements you never reach to item4. :ph34r:

You'll see it better when using Select or switch statement instead of If the else.

So long,

Mega

Thx! :lmao:

Now it's working. I'm just learning this language!


Random

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