1. Computing

2006. Delphi Programming by Zarko Gajic

Delphi Programming Almanac For the Year 2006


AutoFit the Columns in the TDBGrid - 03/28/2006
While DBGrid has many properties and events you can use to create nicely looking and highly configurable user interfaces for data editing, there are always situations when users want more. Let's see how to add the "AutoFit" functionality to the Columns of a TDBGrid component.

Jump to the Last Item in the TListBox Delphi component - 03/27/2006
When dynamically adding items to the ListBox you might want to ensure that the last added item is visible. Here's how to use the TopIndex property to ensure the visibility of the last item (and all the items at the end of the list that can "fit" into the box).

Store and Retrieve DBGrid's Columns Order and Visibility - 03/21/2006
If you allow a user to customize DBGrid's appearance at run time (Columns width and position), when the form is closed and reopened, all the user changes are lost. For a better user experience, it would be ideal if your application could somehow store (and load when needed) all the changes the user has made to the Grid appearance. Here's how.

Programmatically Open the Recycle - 03/20/2006
When you delete a file in Windows Explorer or My Computer, the file appears in the Recycle Bin. The file remains in the Recycle Bin until you empty the Recycle Bin or restore the file. Here's how to programmatically display the Recycle Bin to a user of your Delphi application.

Send information (String, Image, Record) between two Delphi applications - 03/14/2006
Learn how to send the WM_CopyData message between two Delphi applications to exchange information and make two applications communicate. The accompanying source code demonstrates how to send a string, record (complex data type) and even graphics to another application.

Activate a Running Instance when a User Openes an Associated File (By Extension) - 03/13/2006
When a user select more than one file to be opened by your Delphi application (after you have registered your own file type - extension), Windows will start as many new instances of your application as there are files being opened. Here's how to make sure that all the selected files are being handled by only one instance of the application.

Mimic Office 2007 Rich Menus using Owner Drawn TMenuItems - 03/07/2006
A sample Delphi application that demonstrates how you can make your menu items take on the new look of the Office 2007 - coding rich menus using owner drawing techniques.

Run your Delphi Application by Double-Clicking on a File (Register a FileType - Extension with Your Program) - 03/06/2006
When creating applications, it is often necessary to store (application related) data on the file system. You may choose to create your own file type (with a *unique* extension) and then associate that extension with your application through Windows. This tells Windows to automatically run your application when a user double-clicks a file in Windows Explorer, for example.

Storing Record Data in a Blob Field - 02/28/2006
Here's how to store (and retrieve) a record (structure) value into a BLOB field in Delphi database applications.

Use a Function or a Procedure as a Parameter in another Function - 02/27/2006
In Delphi, procedural types allow you to treat procedures and functions as values that can be assigned to variables or passed to other procedures and functions. Here's how to send a function (or a procedure) as a parameter to another function in Delphi.

Convert RGB Color Value to HSB (HSV) Color Value from Code - 02/20/2006
The HSV (Hue, Saturation, Value) model, also called HSB (Hue, Saturation, Brightness), defines a color space commonly used in graphics applications. Hue value ranges from 0 to 360, Saturation and Brightness values range from 0 to 100%. Here's a function to convert a RGB color to a HSV color...

Move ListBox Items with the Mouse (Drag and Drop) - 02/13/2006
Here's how to allow a user to rearrange the items (change position) of a list box using drag and drop...

©2014 About.com. All rights reserved.