Jump to content

Recommended Posts

Posted (edited)

CODE
;I´m Sorry But All of the Helping line and the $Things is on swedich.

;Feel fre to edit if you whant to.

#include <GUIConstants.au3>

GUICreate("MiniRäknaren", 350, 178, 233, 122) ; Programmet

GUICtrlCreateGroup("Räknesätt", 250, 4, 73, 161) ; Grupp

$PLUS = GUICtrlCreateButton("+", 255, 26, 50, 20) ; Knapp

GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") ; Text stolek och annat

$MINUS = GUICtrlCreateButton("-", 255, 53, 50, 20) ; Knapp

GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") ; Text stolek och annat

$GANGER = GUICtrlCreateButton("*", 255, 80, 50, 20) ; Knapp

GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") ; Text stolek och annat

$DELAT = GUICtrlCreateButton("/", 255, 104, 50, 20) ; Knapp

GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") ; Text stolek och annat

$UPPHOJT = GUICtrlCreateButton("^", 255, 130, 50, 20) ; Knapp

GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") ; Text stolek och annat

GUICtrlCreateGroup("", -99, -99, 1, 1) ; Text stolek och annat

$FORSTA = GUICtrlCreateInput("", 8, 48, 81, 21) ; FORSTA Input

$ANDRA = GUICtrlCreateInput("", 120, 48, 89, 21) ; ANDRA Input

GUICtrlCreateLabel("=", 96, 80, 15, 28) ; Likhetstecknet

GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") ; Text stolek och annat

$SVAR = GUICtrlCreateInput("", 40, 112, 129, 21) ; Svar Input

GUICtrlCreateLabel(" Christer Garpenlund ", 0, 160, 100, 17) ; Mitt Namn :)

GUISetState(@SW_SHOW) ; Programmets Status

Do

$nMsg = GUIGetMsg()

If $nMsg = $PLUS Then ; Om man trycker på Plus

$1 = GuiCtrlRead($FORSTA) ; LÄSER FÖRSTA INPUT

$2 = GuiCtrlRead($ANDRA) ; LÄSER ANDRA INPUT

GuiCtrlSetData($SVAR, $1 + $2, "") ; Skriver det SVARET SOM SKA VARA

EndIf

If $nMsg = $MINUS Then ; Om man trycker på Minus

$1 = GuiCtrlRead($FORSTA) ; LÄSER FÖRSTA INPUT

$2 = GuiCtrlRead($ANDRA) ; LÄSER ANDRA INPUT

GuiCtrlSetData($SVAR, $1 - $2, "") ; Skriver det SVARET SOM SKA VARA

EndIf

If $nMsg = $GANGER Then ; Om man trycker på Gånger

$1 = GuiCtrlRead($FORSTA) ; LÄSER FÖRSTA INPUT

$2 = GuiCtrlRead($ANDRA) ; LÄSER ANDRA INPUT

GuiCtrlSetData($SVAR, $1 * $2, "") ; Skriver det SVARET SOM SKA VARA

EndIf

If $nMsg = $DELAT Then ; Om man trycker på Delat

$1 = GuiCtrlRead($FORSTA) ; LÄSER FÖRSTA INPUT

$2 = GuiCtrlRead($ANDRA) ; LÄSER ANDRA INPUT

GuiCtrlSetData($SVAR, $1 / $2, "") ; Skriver det SVARET SOM SKA VARA

EndIf

If $nMsg = $UPPHOJT Then ; Om man trycker på Delat

$1 = GuiCtrlRead($FORSTA) ; LÄSER FÖRSTA INPUT

$2 = GuiCtrlRead($ANDRA) ; LÄSER ANDRA INPUT

GuiCtrlSetData($SVAR, $1 ^ $2, "") ; Skriver det SVARET SOM SKA VARA

EndIf

Until $nMsg = $GUI_EVENT_CLOSE ; Stänger Programmet.

I´m Sorry about the helptext but i´m from sweden :)

Feel free to change the code.

NOW WITH ^ TOO.

Pleace give some things to add.

i tink over PI but dont knew how to add so it be good.

Edited by LokErik

The first error is one step closer to the perfect program.

Posted

I was thinking about to add PI and maybe add ^

But i tought that shuld be fine with this. :)

The first error is one step closer to the perfect program.

Posted (edited)

I was thinking about to add PI and maybe add ^

But i tought that shuld be fine with this. :)

It's very useful if you'r on the run :) because it's simple

P.S. : i forgot to tell you to visit my app :)L|M|TER Media Player

Edited by LIMITER
Posted

CODE
;I´m Sorry But All of the Helping line and the $Things is on swedich.

;Feel fre to edit if you whant to.

#include <GUIConstants.au3>

GUICreate("MiniRäknaren", 350, 178, 233, 122) ; Programmet

GUICtrlCreateGroup("Räknesätt", 250, 4, 73, 161) ; Grupp

$PLUS = GUICtrlCreateButton("+", 255, 26, 50, 20) ; Knapp

GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") ; Text stolek och annat

$MINUS = GUICtrlCreateButton("-", 255, 53, 50, 20) ; Knapp

GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") ; Text stolek och annat

$GANGER = GUICtrlCreateButton("*", 255, 80, 50, 20) ; Knapp

GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") ; Text stolek och annat

$DELAT = GUICtrlCreateButton("/", 255, 104, 50, 20) ; Knapp

GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") ; Text stolek och annat

$UPPHOJT = GUICtrlCreateButton("^", 255, 130, 50, 20) ; Knapp

GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") ; Text stolek och annat

GUICtrlCreateGroup("", -99, -99, 1, 1) ; Text stolek och annat

$FORSTA = GUICtrlCreateInput("", 8, 48, 81, 21) ; FORSTA Input

$ANDRA = GUICtrlCreateInput("", 120, 48, 89, 21) ; ANDRA Input

GUICtrlCreateLabel("=", 96, 80, 15, 28) ; Likhetstecknet

GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") ; Text stolek och annat

$SVAR = GUICtrlCreateInput("", 40, 112, 129, 21) ; Svar Input

GUICtrlCreateLabel(" Christer Garpenlund ", 0, 160, 100, 17) ; Mitt Namn :)

GUISetState(@SW_SHOW) ; Programmets Status

Do

$nMsg = GUIGetMsg()

If $nMsg = $PLUS Then ; Om man trycker på Plus

$1 = GuiCtrlRead($FORSTA) ; LÄSER FÖRSTA INPUT

$2 = GuiCtrlRead($ANDRA) ; LÄSER ANDRA INPUT

GuiCtrlSetData($SVAR, $1 + $2, "") ; Skriver det SVARET SOM SKA VARA

EndIf

If $nMsg = $MINUS Then ; Om man trycker på Minus

$1 = GuiCtrlRead($FORSTA) ; LÄSER FÖRSTA INPUT

$2 = GuiCtrlRead($ANDRA) ; LÄSER ANDRA INPUT

GuiCtrlSetData($SVAR, $1 - $2, "") ; Skriver det SVARET SOM SKA VARA

EndIf

If $nMsg = $GANGER Then ; Om man trycker på Gånger

$1 = GuiCtrlRead($FORSTA) ; LÄSER FÖRSTA INPUT

$2 = GuiCtrlRead($ANDRA) ; LÄSER ANDRA INPUT

GuiCtrlSetData($SVAR, $1 * $2, "") ; Skriver det SVARET SOM SKA VARA

EndIf

If $nMsg = $DELAT Then ; Om man trycker på Delat

$1 = GuiCtrlRead($FORSTA) ; LÄSER FÖRSTA INPUT

$2 = GuiCtrlRead($ANDRA) ; LÄSER ANDRA INPUT

GuiCtrlSetData($SVAR, $1 / $2, "") ; Skriver det SVARET SOM SKA VARA

EndIf

If $nMsg = $UPPHOJT Then ; Om man trycker på Delat

$1 = GuiCtrlRead($FORSTA) ; LÄSER FÖRSTA INPUT

$2 = GuiCtrlRead($ANDRA) ; LÄSER ANDRA INPUT

GuiCtrlSetData($SVAR, $1 ^ $2, "") ; Skriver det SVARET SOM SKA VARA

EndIf

Until $nMsg = $GUI_EVENT_CLOSE ; Stänger Programmet.

I´m Sorry about the helptext but i´m from sweden :)

Feel free to change the code.

NOW WITH ^ TOO.

Pleace give some things to add.

i tink over PI but dont knew how to add so it be good.

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
×
×
  • Create New...