home *** CD-ROM | disk | FTP | other *** search
- *
- * File HELLO.PRG
- *
- SET TALK OFF
-
- DEFINE FORM Hello ;
- PROPERTY ;
- EscExit .T., ;
- Text "A simple dBASE form", ;
- Width 40, Top 3, Left 10, Height 15, ;
- Minimize .T., Maximize .T., ;
- OnClose HelloCls
-
-
- DEFINE TEXT Text1 OF Hello ;
- PROPERTY ;
- ColorNormal "B/W", ;
- Text "Hello world!", ;
- Width 23, Top 3, Left 13
-
- DEFINE PUSHBUTTON Button1 OF Hello ;
- PROPERTY ;
- OnClick Btn1Click, ;
- StatusMessage "Click button to change text.", ;
- Text "Click Me", ;
- Width 12, Top 9, Left 12, Height 2
-
- lVoid = Hello.Open() && Open the form window.
-
- ********************************************************************
- * Btn1Click--Button1 OnClick event handler
- * Change the message that displays on the form, the button label,
- * the color of the button, and the button's status message, all to
- * indicate that the user can click the button to exit. Changing the
- * button's OnClick handler to Btn2Click changes its action to
- * exiting the form window.
- ********************************************************************
- PROCEDURE Btn1Click
- form.Draw = .F. && Prevent form from showing each change.
- form.Text1.ColorHighlight = "R+/B"
- form.Text1.Text = "Goodbye world." && Change form window message.
- form.Text1.Left = 12 && Center new text.
- this.OnClick = "Btn2Click" && Point to event handler that closes form.
- this.StatusMessage = "Click button to exit."
- this.Text = "Goodbye!"
- this.ColorHighlight = "R+/B"
- form.Draw = .T. && Draw all changes at once (reduces flicker).
- RETURN
-
- PROCEDURE Btn2Click && Event handler for Button2 OnClick event
- ? CHR(7) && Beep!
- lVoid = form.Close() && Close form window.
- RETURN
-
- PROCEDURE HelloCls
- lVOID = this.Release()
- RELEASE Hello
- SET TALK ON
- RETURN
-