Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Header method
Message
From
15/01/2004 14:45:26
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
15/01/2004 01:31:37
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00866647
Message ID:
00867255
Views:
17
>Dragan
>
>>Are you sure you still have the old header when you add the new one?
>I have experienced the disappearance of the old header as soon as new one is added - there can be only one. Did this change in VFP8? I know in VFP7 (and older) the old header vanished immediately, as soon as new one was added. For other controls in a column, yes, you can have as many as you want, but header seemed to be special.
>
>You are right. It looks like my tested statement was wrong. I've mixed two solutions. After a closer look to my grid I saw that I remove first. ::(
>
>So the properties need to be stored to some temporary place like an array before NEWOBJECT. This should do the trick.
>
>with myForm.myGrid.Colum1
>LOCAL ARRAY;
> laHeaderProps(2,1)
>*Move the properties needed from old to new header:
>laHeaderProps(1,1)= .Header1.Caption
>laHeaderProps(2,1)= .Header1.FONTBOLD
>*and so on
>
>*remove old header
>.REMOVEOBJECT('Header1')
>.NEWOBJECT('Header2',"MyHeader","MyClass.prg")
>*rename new header
>.Header2.name = 'Header1'
>* now we have a new header Header1!
>.Header1.Caption  = laHeaderProps(1,1)
>.Header1.FONTBOLD = laHeaderProps(2,1)
>wait .header1.class
>endwith
>
That's the way - except I think the RemoveObject is unnecessary. Last time I went through this in detail, a column can't exist without a header, so the moment you remove it, a default header object is created. It vanishes, of course, when you add a new one. Suspend after the Removeobject(), and look it up in the debugger, or in command window - it still has a header. Its caption would probably be "Header1", not your caption, because it's the default header.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform