×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

ADDING METHODS TO FORMS

ADDING METHODS TO FORMS

ADDING METHODS TO FORMS

(OP)
Hi
Can anyone help me with the exact method of putting a user (programmer) defined procedure or method into a form using the NEW notation. The following code works perfectly,but how do I replace form.close() a standard method of form class with my own procedure or method which is still a method of the form (f1) and can access all form properties.

For example f1.pushbutton1.OnClick={;seeme()} where seeme is a UDF to make text1 visible (f1.text1.visible=.t.)doesn't work. It gives 'Data type mismatch. Expecting object' when the button is clicked.

This doesn't really surprise me but what is the solution?

This particular form is just an experiment to try to solve this problem and also for learning purposes.
Many Thanks
TonyR

LOCAL f1

f1=NEW FORM()
f1.left=67
f1.top=10
f1.height=25
f1.width=100
text1=NEW TEXT(f1)
f1.text='I AM A FORM'
f1.text1.text='THIS IS A FORM'
f1.text1.top=10
f1.text1.height=1
f1.text1.left=50
f1.text1.width=30
f1.text1.FontBold=.f.
f1.text1.visible=.f.
pushbutton1=NEW PUSHBUTTON(f1)
f1.pushbutton1.left=10
f1.pushbutton1.top=20
f1.pushbutton1.height=2
f1.pushbutton1.width=12
f1.pushbutton1.text='click me'

f1.pushbutton1.OnClick={;form.close()}

f1.open()

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close