Jump to content

não consigo separar os itens, exemplo: selecionar 1 na primeira e 1 na segunda caixa, clica em ok e abre a pasta 1.


Go to solution Solved by Andreik,

Recommended Posts

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form 1 = GUICreate("Form1", 261, 241, 193, 125)$Combo 1 = GUICtrlCreateCombo("select", 56, 48, 145, 25)GUICtrlSetData(-1, "1 - ganhou|2 - perdeu")$Combo 2 = GUICtrlCreateCombo("select", 56, 80, 145, 25)GUICtrlSetData(-1, "1 - vitoria|2 - derrota")$Button 1 = GUICtrlCreateButton("Sair", 136, 128, 67, 25, 0)$Button 2 = GUICtrlCreateButton("OK", 56, 128, 59, 25, 0)






GUISetState(@SW_SHOW)
#EndRegion ### END Seção GUI do Koda ###

Enquanto 1
$nMsg = GUIGetMsg() Switch
$nMsg Case $GUI_EVENT_CLOSE
Exit Case $Button 1 Exit



Case $Combo 1 GUICtrlRead($Combo 1, "1 - ganhou")
GUICtrlRead($Combo 2, "1
- vitoria")


Case $Button 2 ShellExecute("C:resultado na pasta 1

", 0)

; Exit

Case $Combo 2 GUICtrlRead($Combo 1, "2 - perdeu")
GUICtrlRead($Combo 2, "2 - derrota")


Case $Button 2 ShellExecute("C:resultado na pasta 2

", 0)
; Sair

            

    EndSwitch
   WEnd

Link to comment
Share on other sites

  • Developers

Sorry but this is an English for so please stick to posting only in English. Read here how to post code and simply use a proper title with an explanation in the post itself.

I assume this is supposed to be an example?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Je maintiendrai, SOU NOVO nisto e estou tentando aprender, me desculpe se fiz errado, faz 3 dias que estou tentando fazer dar certo, desde já agradeço, ME DESCULPA. Je amigo

Link to comment
Share on other sites

Posted (edited)

 

 

Google translation is like weird when it tried to translate this.
I think this user wants this?


Teste o código atualizado e verifique se ele atende às suas necessidades. Se você tiver outras dúvidas ou problemas, não hesite em perguntar, mas em inglês. Estamos aqui para ajudar!

#include <GUIConstants.au3>

#Region ### SEÇÃO INICIAL DO Koda GUI ### Form=
$Form1 = GUICreate("Form1", 261, 241, 193, 125)
$Combo1 = GUICtrlCreateCombo("selecionar", 56, 48, 145, 25)
GUICtrlSetData(-1, "1 - ganhou|2 - perdeu")
$Combo2 = GUICtrlCreateCombo("selecionar", 56, 80, 145, 25)
GUICtrlSetData(-1, "1 - vitória|2 - derrota")
$Button1 = GUICtrlCreateButton("Sair", 136, 128, 67, 25, 0)
$Button2 = GUICtrlCreateButton("OK", 56, 128, 59, 25, 0)

GUISetState(@SW_SHOW)
#EndRegion ### FIM DA SEÇÃO GUI do Koda ###

Enquanto 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            Exit
        Case $Button2
            $selectedItem1 = GUICtrlRead($Combo1)
            $selectedItem2 = GUICtrlRead($Combo2)

            Switch $selectedItem1
                Case "1 - ganhou"
                    Switch $selectedItem2
                        Case "1 - vitória"
                            ShellExecute("C:\pasta1", 0)
                        Case "2 - derrota"
                            MsgBox(0, "Erro", "Combinação inválida selecionada!")
                    EndSwitch
                Case "2 - perdeu"
                    Switch $selectedItem2
                        Case "1 - vitória"
                            MsgBox(0, "Erro", "Combinação inválida selecionada!")
                        Case "2 - derrota"
                            ShellExecute("C:\pasta2", 0)
                    EndSwitch
                Case Else
                    MsgBox(0, "Erro", "Combinação inválida selecionada!")
            EndSwitch
    EndSwitch
WEnd

 

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 261, 241, 193, 125)
$Combo1 = GUICtrlCreateCombo("select", 56, 48, 145, 25)
GUICtrlSetData(-1, "1 - won|2 - lost")
$Combo2 = GUICtrlCreateCombo("select", 56, 80, 145, 25)
GUICtrlSetData(-1, "1 - victory|2 - defeat")
$Button1 = GUICtrlCreateButton("Exit", 136, 128, 67, 25, 0)
$Button2 = GUICtrlCreateButton("OK", 56, 128, 59, 25, 0)

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            Exit
        Case $Button2
            $selectedItem1 = GUICtrlRead($Combo1)
            $selectedItem2 = GUICtrlRead($Combo2)

            Switch $selectedItem1
                Case "1 - won"
                    Switch $selectedItem2
                        Case "1 - victory"
                            ShellExecute("C:\folder1", 0)
                        Case "2 - defeat"
                            MsgBox(0, "Error", "Invalid combination selected!")
                    EndSwitch
                Case "2 - lost"
                    Switch $selectedItem2
                        Case "1 - victory"
                            MsgBox(0, "Error", "Invalid combination selected!")
                        Case "2 - defeat"
                            ShellExecute("C:\folder2", 0)
                    EndSwitch
                Case Else
                    MsgBox(0, "Error", "Invalid combination selected!")
            EndSwitch
    EndSwitch
WEnd

 

Edited by Skeletor

Kind Regards
Skeletor

"Coffee: my defense against going postal."

Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen | Full Screen UI

Link to comment
Share on other sites

  • Developers
10 hours ago, davi7 said:

Je maintiendrai, SOU NOVO nisto e estou tentando aprender, me desculpe se fiz errado, faz 3 dias que estou tentando fazer dar certo, desde já agradeço, ME DESCULPA. Je amigo

Sure,  Now start posting in English so we can understand! ;)   

ps: the name is Jos and "Je maintiendrai" is an hint to where I come from)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Solution
9 hours ago, Jos said:

Sure,  Now start posting in English so we can understand! ;)   

ps: the name is Jos and "Je maintiendrai" is an hint to where I come from)

France? So I lived last 15 years with the impression that your are from Netherlands. :o

When the words fail... music speaks.

Link to comment
Share on other sites

Deepl.com returns very good results for Portuguese and other languages :)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

  • Developers
1 hour ago, Andreik said:

France? So I lived last 15 years with the impression that your are from Netherlands. :o

Not France! Check out: https://en.m.wikipedia.org/wiki/Coat_of_arms_of_the_Netherlands

Jos :)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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...