>>>IMO, the easiest (and what I have in code somewhere)
>>>
>>>save the caption and whatnot from the old header
>>>add the new header
>>>apply the saved properties
>>>bindevent to the new header any behavior you need.
>>
>>After reading your comment I did this:
>>
>>Create newheader.prg:
>>
DEFINE CLASS MyHeader AS Header
>>
>> Caption = "Header"
>> FontName = "Wingdings"
>> FontSize = 8
>>
>> * put whatever behavior
>>
>>ENDDEFINE
>>
>>Create a form, add a table and drop that table on the form, thus creating a grid. Then enter the grid's Init method and add this:
>>
set proc to newheader.prg
>>
>>this.column1.addobject( 'header2', 'myheader' )
>>
>>Then CTRL+E. And indeed the first column displays very nicely the caption in wingdings. This all in VFP7 indeed.
>>
>>The funny thing is that its reference is now Header2, but that Header1 no longer exists indeed, as this code proofs. The first line creates an error.
>
>Try to give it any other name, including (maybe) Header1, and it should work with whatever name you give it. Because the moment you add the new one, the old one is destroyed.
>
>>
wait wind this.column1.header1.caption
>>wait wind this.column1.header2.caption
>>
>>Your words
"because a column must, at any time, have one and only one column" should be
"because a column can at any time have one and only one header".
>
>Lapsus capitis...
Something wrong with your head? :-)
Update: I think I now know the reason for first doing RemoveObject( 'header1' ). That is required when you want to have your replacement to have exactly that name.
Groet,
Peter de Valença
Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.