You can use this simple function I made a while back, which is very useful.
Here it is:
Function ClickBox(x1,y1,x2,y2,Click)
Clicked=0
If MouseClick()=Click and MouseX()=>x1 and MouseY()=>y1
If MouseX()=<x2 and MouseY()=<y2
Clicked=1
EndIf
EndIf
EndFunction Clicked
You can actually put the if statement into a single line, but I usually don't.
So here's an example of how to use it:
Ink Rgb(0,0,255),0
Do
Cls
Box 100,100,200,200
If ClickBox(100,100,200,200,1)=1 Then Center Text 320,240,"Button Clicked"
Loop
Function ClickBox(x1,y1,x2,y2,Click)
Clicked=0
If MouseClick()=Click and MouseX()=>x1 and MouseY()=>y1
If MouseX()=<x2 and MouseY()=<y2
Clicked=1
EndIf
EndIf
EndFunction Clicked
You need to put five parammeters into the "ClickBox" function. The first two are you're button's top left positions (x,y). The third and fourth are the button's bottom right positions (x,y). And the last is what click value, a 0 means no click, a 1 means left click, a 2 means right click, and a 3 means a left and right click together.
The "ClickBox" function will return either a 0 for false or a 1 for true. And thats all there is to it, let me know if you have any questions
.