Local $BA[] = ["Sin", "Tan", "Cos", "Exp", "Log", "7", "8", "9", "+", "C", "4", "5", "6", "-", "SqRt", "1", "2", "3", "*", ".", "0", "(", ")", "/", " = "]
$hGui = GUICreate("Calc", 360, 400, 229, 138, 0x10000000 + 0x20000000 + 0xC00000 + 0x80000) ;VISIBLE, MINIMIZEBOX, CAPTION, POPUP, SYSMENU
$D = GUICtrlCreateInput("", 8, 8, 344, 31, BitOR(0x00000080, 2)) ;$ES_AUTOHSCROLL, $ES_RIGHT
For $j = 0 To UBound($BA) - 1 ;make the buttons
$BA[$j] = GUICtrlCreateButton($BA[$j], Mod($j, 5) * 70 + 7, Int($j / 5) * 70 + 50, 65, 63)
$sB = GUICtrlSetFont(-1, 18, 400, 0, "MS Sans Serif")
Next
While Execute(Assign("j", GUIGetMsg()) And $j <> -3)
If $j > 0 And Assign("sB", GUICtrlRead($j)) And Call($sB, GUICtrlRead($D)) Then GUICtrlSetData($D, Call($sB, GUICtrlRead($D))) ;Sqrt; Tan; Cos..
Execute($j - $D > 0xDEAD - @error And GUICtrlSetData($D, ($sB = "C" Or $sB = " = ") ? Execute(StringLeft($sB, 1) & GUICtrlRead($D)) : GUICtrlRead($D) & $sB))
WEnd
11 lines with a bit different method
Still 11 Lines but its a bit more concise back to dynamic 'C' and '=' buttons
and I showed how to add more named functions like Tan() Cos() Sin()