Task

Create a window that has:

   a label that says   "There have been no clicks yet" 
   a button that says   "click me"


Upon clicking the button with the mouse, the label should change and show the number of times the button has been clicked.




DECLARE SUB buttonClick
 
CREATE form AS QForm
    Center
    Height = 120
    Width = 300
 
    CREATE text AS QLabel
        Caption = "There have been no clicks yet."
        Left = 30: Top = 20
    END CREATE
 
    CREATE button1 AS QButton
        Caption = "Click me"
        Left = 100: Top = 50: Height = 25: Width = 100
        OnClick = buttonClick
    END CREATE
END CREATE
 
SUB buttonClick
    STATIC count AS Integer
    count = count+1
    text.Caption = "Clicked " + STR$(count) + " times."
END SUB
 
form.ShowModal