Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
' === Knoppenrijen (cijfers en operatoren) === chars$ = "789/456*123-0.+" id = 10 x0 = 10 : y0 = 90 w = 60 : h = 30 : m = 5
For i = 1 To Len(chars$) cx = ((i - 1) Mod 4) cy = Int((i - 1) / 4) x = x0 + cx * (w + m) y = y0 + cy * (h + m) teken$ = Mid$(chars$, i, 1) GUI BUTTON #id, teken$, x, y, w, h, RGB(white), RGB(200,200,200) id = id + 1 Next
' === Eigen REPLACE functie === Function REPLACE$(tekst$, zoek$, vervang$) Local p, result$ result$ = "" Do p = Instr(tekst$, zoek$) If p = 0 Then result$ = result$ + tekst$ Exit Do EndIf result$ = result$ + Left$(tekst$, p - 1) + vervang$ tekst$ = Mid$(tekst$, p + Len(zoek$)) Loop REPLACE$ = result$ End Function
' === Hoofdlus ===
Do
text 10,10,""+str$(a) ' Bereken knop (#4) If CtrlVal(#4) = 1 Then expr$ = CtrlVal(#1) expr$ = REPLACE$(expr$, " ", "") If Left$(expr$,1)="=" Then expr$ = Mid$(expr$,2) On ERROR SKIP result = Eval(expr$) CtrlVal(#3) = Str$(result) CtrlVal(#4) = 0 EndIf
' DEL knop (#2) If CtrlVal(#2) = 1 Then tekst$ = CtrlVal(#1) If Len(tekst$) > 0 Then CtrlVal(#1) = Left$(tekst$, Len(tekst$)-1) CtrlVal(#2) = 0 EndIf
' Knoppen 10 t/m 24 (invoer) For id = 10 To 24 If CtrlVal(#id) = 1 Then toevoeg$ = Mid$(chars$, id - 9, 1) CtrlVal(#1) = CtrlVal(#1) + toevoeg$ CtrlVal(#id) = 0 EndIf Next
' navigatie knop (#25) If CtrlVal(#25) = 1 Then CtrlVal(#25) = 0 gui page 2 EndIf
Pause 50 Loop
phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 2689
Posted: 12:29pm 21 Jul 2025
Copy link to clipboard
Print this post
Is this what you are after? CLOUR foreground_colour, RGB(Yellow)
Or perhaps start the program with:-
CLS RGB(yellow)
Then add your GUI elements. After closing a GUI element use:-
BOX x, y, w, h, 1, RGB(yellow), RGB(yellow)
To restore yellow to that area.
tenij000 Regular Member Joined: 30/05/2025 Location: NetherlandsPosts: 51