Hi!
You do nto need a line "MyText = createobject('MyText')"
Also, to be able to use "MyText" class, it should be loaded into the memory. If class is defined in the class library, it is a "SET CLASSLIB TO ... ADDITVE" command. If you use PRG for defining a class (like in your sample), it is a "SET PROCEDURE TO ... ADDITIVE" command. However, in VFP6 there are new methods nad commands. Instead of CreateObject() you can use NewObject(), and instead of the AddObject method for column you can use NewObject method. NewObject function and method has additional parameters - pathname to the module where class is defined (class library or EXE). However, there are no way to use PRG here, sp better to follow the Nadya's suggestion to create a class in visual class library instead of defining it in the PRG.
By the way, read my VFP Grids articles in the Universal Thread Magazine, startign from the August 2001 issue. There is a chapter dedicated to accurate and simple organizing of cascading of various events in the grid from controls, columnd and headers.
There are also a header class sample with catching of column resize and move in the File#
9970 (events were used to refresh the indicator of sorting).
HTH.
>Right - so I am trying to get this working for me...
>
>In a program called gridsupport.prg I have this...
>
>
>MyText = createobject('MyText')
>define class MyText as textbox
>name = 'MyText'
>proc Click
>this.Parent.Parent.click()
>endproc
>enddefine
>
>
>and in the init of my grid...
>
>
>do gridsupport
>
>
>and in the code I displayed earlier I have added this...
>
>
>.AddObject('Text1', 'MyText')
>
>
>Is this how it's supposed to work because I don't really understand the example of creating it all from scratch...
>
>I get an error with this though - "Class definition "MYTEXT" is not found."
>
>Sorry to be dense!
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.