Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cesar
  Where is Cesar?
 
 Brazil
 Cesar
 To: Kulwant Singh
  Where is Kulwant Singh?
 Shimla
 India
 Kulwant Singh
 Tags
Subject: RE: Set All for Methods
Thread ID: 248825 Message ID: 248829 # Views: 1 # Ratings: 4
Version: Visual FoxPro 9 Category: Classes and Objects
Date: Wednesday, December 23, 2009 5:12:07 PM         
   


> Dear Experts,
>
> If I have say 50 buttons on a form, I can set a uniform property for all of them at one go with the "SetAll" method.
> Is there a command with which I can Set a Uniform Code for "Events" of all these buttons with one stroke.
> For example I wish to put the same piece of code in the "Got Focus" event of all these buttons, will I need to select individual buttton and put the codes there?
>
> Can someone please guide me?
>
> Thanks!
> kulwant
> (Help Save the TIGER. Save Wildlife. Live & let Live)

Kulwant,

You can use BindEvents for that.

Do the following:
Create a new method in your form that will handle all chosen events, like TxtLostFocus.

To control it loop through your form controls

FOR EACH loControl in Thisform.Controls
 ...
  BINDEVENT(Thisform, loControl, Thisform, TxtLostFocus)

ENDFOR




Regards,

Cesar
My Blog

ENTIRE THREAD

Set All for Methods Posted by kulwant singh @ 12/23/2009 4:25:44 PM
RE: Set All for Methods Posted by Stefan Wuebbe @ 12/23/2009 4:34:23 PM
RE: Set All for Methods Posted by kulwant singh @ 12/23/2009 5:12:55 PM
RE: Set All for Methods Posted by Cesar @ 12/23/2009 5:12:07 PM
RE: Set All for Methods Posted by kulwant singh @ 12/23/2009 5:17:02 PM
RE: Set All for Methods Posted by Stefan Wuebbe @ 12/23/2009 5:39:27 PM
RE: Set All for Methods Posted by ho me @ 12/23/2009 5:50:15 PM
RE: Set All for Methods Posted by Stefan Wuebbe @ 12/23/2009 5:51:39 PM
RE: Set All for Methods Posted by kulwant singh @ 12/23/2009 6:12:32 PM
RE: Set All for Methods Posted by Stefan Wuebbe @ 12/24/2009 8:56:02 AM