Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Coloring themed grid headers

Status
Not open for further replies.

steve4king

IS-IT--Management
Feb 6, 2007
154
US
I've seen several posts about having no control over themed headers.
So far people just say, "OK turned of themes and it works now."

Problem is.. that's not good enough. Using this solution the grid will look flat and outdated.
The only solution I can think of is a semi-transparent overlay.. which is a bit of a bad hack.

Are there other options? Activex control to replace it? Is there a better workaround?

Thanks,
-Stephen
 
Just my oppinion:

If you want a modern grid header look you don't need colored headers. How about using header.picture?

ActiveX? Webbrowsercontrol and HTML+CSS+Graphics? Webbrowsercontrol and Silverlight? Flash? You can do that, but you won't have the same kind of databinding. Of course all other technologies also have their data binding techniques, RIA, OData, whatever. It's a reasonable additional effort to add logic to bind the dbf or cursor you now have to any other grid needing a recordset or dataset or whatever. But it's something on top of redesigning the look, which is not seen by end users and often underestimated.

If you need a better look the only really viable option is to leave foxpro overall. I don't see a value of patching the looks. There are skinning tools, but I haven't seen one integrate seamless into VFP. They often depend on a hwnd, which only activex controls have, VFP is making more use of GDI+ and themes, but is still having it's own controls with the databinding of controlsouce/rowsource/recordsource/value you know and want to stay with. If you really want to do patchwork, GDI+ is an option, there are samples showing how to draw gradients even in the form titlebar, you can also do that in the canvas area of forms.

Bye, Olaf.

 
Stephen,

In some of my applications, I use a third-party ActiveX grid control - one that gives me the "modern" look, plus has lots of features that aren't present in the native VFP grid.

The control I use is the Codejock Report Control ( (don't be confused by the name; it's a grid, not a report). But there are several similar products around that you might also consider.

That said, switching to a third-party grid simply to get a better-looking column header would be a big step, so I would only recommend it if your need is desperate.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Hah, Olaf, while I agree to some extent. My artistic opinion only goes so far. In the end it comes down to the demands of the customer. GDI+ was the way I was thinking of going initially, but I do not want to block click/drag access to the grid headers either. Catching the location of the on-click event on my image and translating that to a click/drag on the underlying image seems risky(will it work perfectly at every resolution) and a too complicated just to change a color.

Mike, I've been leery going with ActiveX controls for fear that they will not load as quickly or scale/resize as well as native controls. Have you found the dimension of complexity these add to be significant?
 
You miss the point, I said gdiplus can even draw on the title bar, you can also draw on a header and keep it a header. You don't need to replace or overlay headers with image controls. The form canvas is the inner form, anywhere on it.

The problem you will faace is: redraw/paint event, rsizing of headers, etc. It's not simply drawing on a header in the init. There is much more invovled, which makes it much easier to use a different control.

Bye, Olaf.
 
Steve,

No, I wouldn't agree with a blanket statement that ActiveX controls load more slowly or don't resize as well as native ones. Some are better. Some are worse. In most cases, there are trade-offs, and there's no outright winner.

But you're rght to be hesitant. In this particular case, I wouldn't switch to a different control just for cosmetic reasons - unless the client absolutely insists, of course.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top