Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cecil Champenois
  Where is Cecil Champenois?
 Little Elm
 Texas - United States
 Cecil Champenois
 To: Jun Tangunan
  Where is Jun Tangunan?
 Cabanatuan
 Philippines
 Jun Tangunan
 Tags
Subject: RE: How do you ADD a Property to a GRID?
Thread ID: 209765 Message ID: 209770 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Grids
Date: Wednesday, December 31, 2008 5:25:56 AM         
   


> >
> > Thanks Glenn. I had previously done this through a class, but wondered if it was possible outside of a class, without hacing the form's scx/sct files?
> >
> > Cecil Champenois, Jr.
>
>
> Try this:
>
>
>
Local oForm
> oForm = Createobject('TestForm')
> oForm.Show(1)
> 
> Define Class TestForm As Form
> 	Height = 210
> 	Width = 250
> 	AutoSize = .T.
> 
> 	Add Object Grid1 As Grid With ;
> 		Height = 100, ;
> 		Width = 200, ;
> 		Left = 10, ;
> 		Top = 60,;
> 		AllowCellSelection = .F.
> 		
>     ADD OBJECT Label1 as Label WITH ;
>         Caption = "Double-click grid!",;
>         Autosize = .T.,;
>         Top = 20,;
>         Left = 10
> 
> 	Procedure Load
> 	    Create Cursor junk (xname c(10))
> 	    Insert Into junk Values ("Dble Click!")  && Just so the grid will have record
> 	Endproc
> 
> 	Procedure Init
> 	    Thisform.Grid1.AddProperty("otest","Cecil")  && Create the property
> 	Endproc
> 
> 	Procedure Grid1.DblClick
> 	    Messagebox(This.otest)  && Show previous value
> 	    This.otest = "Jun"      && change value
> 	    Messagebox(This.otest)  && Check if value has changed
> 	Endproc
> 
> Enddefine

>
>
> Jun Tangunan
> http://weblogs.foxite.com/sandstorm36/

Well, that is certainly one way to do it! Thanks! I thought maybe I could hack a new property in, but I guess not. Either I use the above OOPs code or I use a class.

Cecil Champenois, Jr.

ENTIRE THREAD

How do you ADD a Property to a GRID? Posted by Cecil Champenois @ 12/31/2008 3:17:12 AM
RE: How do you ADD a Property to a GRID? Posted by Glenn Villar @ 12/31/2008 3:52:30 AM
RE: How do you ADD a Property to a GRID? Posted by Cecil Champenois @ 12/31/2008 4:46:00 AM
RE: How do you ADD a Property to a GRID? Posted by Jun Tangunan @ 12/31/2008 5:16:43 AM
RE: How do you ADD a Property to a GRID? Posted by Cecil Champenois @ 12/31/2008 5:25:56 AM
RE: How do you ADD a Property to a GRID? Posted by Glenn Villar @ 12/31/2008 6:05:31 AM
RE: How do you ADD a Property to a GRID? Posted by Andy Kramek @ 12/31/2008 11:25:10 AM