So if I put Coût de la propriété (price in $) as 100 000 and Mise de fonds (down payment in $) as 25 000, it should update the percentage box to 25% (vMiseFondsP). If I edit the percentage to 30% then it should update the down payment box in $ to 30 000$. Basically I want the edit boxes to refresh according to the last edited box. Right now I'm using Ctrl+M to do the calculations, but I'm guessing I would need a loop or something of the sort as well. Thanks!
Code: Select all
#NoEnv
#InstallMouseHook
#InstallKeybdHook
#MaxThreadsPerHotkey 2
#WinActivateForce
#SingleInstance Force
SendMode Input
DetectHiddenWindows On
SetControlDelay 1
SetWinDelay 0
SetKeyDelay, 10, 10
SetMouseDelay 1
SetBatchLines -1
SetTitleMatchMode 3
; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GUI ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; Generated by AutoGUI 1.4.8a
#NoEnv
#SingleInstance Force
SetWorkingDir %A_ScriptDir%
Gui Add, Text, x46 y29 w120 h23 +0x200, Coût de la propriété:
Gui Add, Text, x47 y63 w120 h23 +0x200, Mise de fonds:
Gui Add, Text, x45 y97 w120 h23 +0x200, Montant du prêt:
Gui Add, Text, x46 y131 w120 h23 +0x200, Taux d'intérêt:
Gui Add, DropDownList, x216 y165 w120, 5 ans|10 ans|15 ans|20 ans|25 ans||
Gui Add, Text, x46 y165 w120 h23 +0x200, Période d'amortissement:
Gui Add, Edit, x216 y29 w120 h23 vCout, 0
Gui Add, Edit, x216 y63 w120 h23 vMiseFonds, 0
Gui Add, Edit, x416 y63 w120 h23 vMiseFondsP, 0
Gui Add, Edit, x216 y97 w120 h23 vPret, 0
Gui Add, Edit, x216 y131 w120 h23 vTaux, 0
Gui Add, Text, x46 y203 w124 h23 +0x200, Fréquence des versements:
Gui Add, DropDownList, x216 y203 w120 vHypCourt, 1 Semaine|2 Semaines||1 Mois|
Gui Show, x503 y298 w697 h477, Window
Return
GuiEscape:
GuiClose:
ExitApp
; Do not edit above this line
; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~^m::
{
GuiControlGet, Cout
Tooltip, %Cout%
GuiControlGet, MiseFonds
Tooltip, %MiseFonds%
GuiControlGet, MiseFondsP
Tooltip, %MiseFondsP%
GuiControlGet, Pret
Tooltip, %Pret%
GuiControlGet, Taux
Tooltip, %Taux%
GuiControlGet, HypCourt
Tooltip, %HypCourt%
GoTo, Calculations
}
return
Calculations:
{
Tooltip
MiseFonds := Cout*MiseFondsP/100
tooltip, %MiseFonds%
}
return
~PGDN::ExitApp