|
|
|
Delphi - Developer Express - .Net & XP Styles (2)
HeaderColor - Once again a little modification of colour and the grids harmonise like XP. Its important to choose pale colours that blend well.
Ok, the grids are looking much better already. Now lets take a look at some code we can use to tailor the actual colour of individual columns and rows. To help explain this we have created a sample project which you can download. We assume that you have SQL Server 2000 (or similar) which has the Pubs database. You may need to alter the database connection string to use our code, we have used user=sa, no password, on a local server. We are also going to use ADO as our data access technology, we will assume you have installed the 'ADO update pack for Delphi' to fix the ADO bugs.
First of all, we have created our form and placed two data aware grids, the Developer Express dxDBGrid and the Delphi DBGrid. They are side by side so we can easily compare the two. We have also added a single button which pulls all the records from the Authors table of the Pubs database. Now, we are going to tailor the Developer Express grid to show off some of the features to make our application look like .Net. To do this we have also added an ImageList component to have some embedded images to add to our grid.
We are going to add 3 columns to each grid to show fields for author first name, last name and state. To make our grid look more like XP we are going to introduce the first XP stylization. This stylization will make the state column appear as a different colour making it easier to distinguish from the name columns. To achieve this we simply have to double click the dxDBGrid to see our list of columns:
|
|
Featured |
Other popular Delphi resources. Why not try them for yourself?
|
|
Delphi Knowledge Base. Best practices, walkthroughs, tutorials, component advice and more. Solutions and professional designs for Delphi 4, Delphi 5, Delphi 6 and Delphi, 7. Word COM, Excel COM, Outlook COM including code examples for Word OLE, Excel OLE and Outlook OLE. Automating Outlook to create MailItem and send attachments in Delphi. ActiveX, Com. ADO Data Architecture, TMS component pack walk through and code examples. Using Developer Express and example walkthroughs. Date & time conversion routines, video playback and frame manipulation. COM articles, papers, tips, techniques and hints. How to create Word reports and excel spreadsheets using Delphi code and OLE automation. Understanding Delphi encryption and using ciphers, with source code examples of Blowfish, Twofish, and Rijndael. Securing application data and confidential information using open source encryption components. Free encryption dll component. Accessing and managing MS Excel sheets with Delphi. How to retrieve, display and edit Microsoft Excel spreadsheets with Delphi automation. Accessing and managing MS Word documents with Delphi. How to retrieve, display and edit Microsoft Word documents using Delphi automation. Read and write Excel spreadsheets using Delphi code. How to read and write registry entries using Delphi code. Source code examples using Delphi 5, Delphi 6 and Delphi 7. Working with VCL Developer Express components. How to apply grid styles and themes to Delphi applications. Using image columns and shading to improve the grid and treeview appearances. Including examples from ExpressQuantumPack, for Delphi, ExpressPack for Delphi. Developer guides for Developer Express components. All our articles are written by our senior Delphi professionals to help you get the best from your legacy Delphi applications |
|