Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Bong Bungalan
  Where is Bong Bungalan?
 gensan
 Philippines
 Bong Bungalan
 To: Bhushan Sahni
  Where is Bhushan Sahni?
 Jabalpur/Mumbai
 India
 Bhushan Sahni
 Tags
Subject: RE: Adding Header.Click() event at runtime
Thread ID: 268547 Message ID: 268551 # Views: 34 # Ratings: 0
Version: Visual FoxPro 9 Category: Classes and Objects
Date: Tuesday, July 13, 2010 8:33:49 AM         
   


Hi Bhushan,

Thanks for the very quick reply.

My first encounter with bindEvent were unclear actually on what are those parameters. but in your example, this is what I understood: correct me if I am wrong.

BINDEVENT(Thisform.Grid1.ColumnX.Header1,"Click",thisform,"YourMethodName")

1. this "Thisform.Grid1.ColumnX.Header1" << ths is the reference of the control of which "Click" is to be bound.
2. "Click" simply the Event
3. "thisform" is the container which "YourMethodName" is a member.
4. "YourMethodName" is the custom procedure that is to be implemented by declaring
Define Class SearchForm as Form

	Procedure init()
	.
        .
        .
        Procedure YourMethodName()

Enddefine



Kind Regards,

BOng
>
> Hi,
>
> You will have to use BINDEVENT and its Simple not complicated :)
>
>
> The First two parameters are the Object name and its event, in your case it will be the Thisform.Grid1.ColumnX.Header1 and Click. For rest of the two parameters, you can create a method in the form and write the code there and then associate that method to the click event of the header. so the command will be
>
>
BINDEVENT(Thisform.Grid1.ColumnX.Header1,"Click",thisform, "YourMethodName")

>
> This is dynamic binding of the event to a method.
>
> PS : You cannot use parameters in BindEvent :(
>
> Also, you can create your header class and use it instead of the native header object
>
> Regards
> Bhushan Sahni
> Eitzen Group (IT)
> bsh@eitzen-group.com
> Visual Foxpro a dream house for developers

ENTIRE THREAD

Adding Header.Click() event at runtime Posted by Bong Bungalan @ 7/13/2010 8:15:49 AM
RE: Adding Header.Click() event at runtime Posted by Bhushan Sahni @ 7/13/2010 8:20:56 AM
RE: Adding Header.Click() event at runtime Posted by Bong Bungalan @ 7/13/2010 8:33:49 AM
RE: Adding Header.Click() event at runtime Posted by Bhushan Sahni @ 7/13/2010 8:35:09 AM
RE: Adding Header.Click() event at runtime Posted by Stefan Wuebbe @ 7/13/2010 8:37:29 AM
RE: Adding Header.Click() event at runtime Posted by Bong Bungalan @ 7/13/2010 9:12:34 AM
RE: Adding Header.Click() event at runtime Posted by Stefan Wuebbe @ 7/13/2010 10:00:19 AM
RE: Adding Header.Click() event at runtime Posted by Bong Bungalan @ 7/13/2010 2:18:31 PM
RE: Adding Header.Click() event at runtime Posted by Stefan Wuebbe @ 7/13/2010 3:29:19 PM
RE: Adding Header.Click() event at runtime Posted by Bong Bungalan @ 7/13/2010 3:52:15 PM
RE: Adding Header.Click() event at runtime Posted by Stefan Wuebbe @ 7/13/2010 4:17:35 PM
RE: Adding Header.Click() event at runtime Posted by Bong Bungalan @ 7/13/2010 4:31:10 PM
RE: Adding Header.Click() event at runtime Posted by tushar @ 7/13/2010 4:23:10 PM
RE: Adding Header.Click() event at runtime Posted by Bong Bungalan @ 7/13/2010 4:37:24 PM
RE: Adding Header.Click() event at runtime Posted by tushar @ 7/13/2010 4:43:17 PM
RE: Adding Header.Click() event at runtime Posted by tushar @ 7/13/2010 8:46:25 AM