1. Technology
Send to a Friend via Email

About Delphi Programming Tips - 2010

Delphi tips from the free About Delphi Programming newsletter, year 2010.

Remove Automatic Accelerator Keys For Delphi Menu Item
By default the AutoHotkeys property of a Delphi TMainMenu or TPopupMenu has the value of maAutomatic. This will add the & sign to the menu item Caption. What if you need to compare the value of the Caption string to some hard coded value (the expected Caption value set at design time)?

Delete Facebook Account From a Delphi Application
Software programs should help people do their daily job. Maybe you have an application hosting TWerBrowser component allowing users to reach and browse their favorite web sites directly from your Delphi application. Never mind the reason, if a user wants to permanently remove his/her Facebook account, you as a developer could help the user by making it easy for the user to reach the "Delete My Ac…

Store RTF As A Resource - Load Resource RTF Into a TRichEdit
If your application needs external pre-made files like sounds and other raw data, beside distributing separate files for your application's use, you can add the raw data to your application as a resource. Here's how to store and load RTF (rich text document) data as a resource in Delphi applications.

Drag Multiple Files From Delphi's TShellListView
When MultiSelect property of a TShellListView control is set (to true), to get the list of selected files, you need to iterate through items and check if an item is selected. Here's how to drag drop multiple files in Delphi applications using TShellListView.

Selecting a TListView Item on Item Check / Uncheck
You will notice that checking or unchecking the item in a list view will not change the selected item - the item that gets checked will not get selected. If you need to have the item Selected when Checked, you need to handle the OnMouseDown even of the TListView. Here's how for Delphi's TListView.

Redirect Mouse Wheel Message To A Control Under The Mouse in Delphi A…
Mouse wheel is used for scrolling. When a scrollable control (TMemo, TListView, TTreeView, ...) has the input focus, moving the wheel will result in vertical scrolling of the content of the focused control. Here's how to enhance the functionality of mouse wheel so that moving the mouse wheel scrolls the control directly under the mouse cursor and not the one with the keyboard focus, which is defa…

Activate Keyboard Layout / Input Identifier
If you need to allow the user of your Delphi application to use different languages / keyboard layouts to input data, you would need to mimic the "Text Service and Input Languages" Control Panel applet.

Run Your Delphi Application in Full Screen - Implement "F11 -…
Running in full screen, where an application UI covers the entire screen, over the TaskBar and any Desktop/Tool bars, is handy when a user has a limited screen size (netbooks) or when you just want more to be visible by the broswer or the Windows Explorer. Here's how to implement full-screen mode in your Delphi applications.

Auto Select All The Text For TCustomEdit On Mouse Click
Delphi's T(Custom)Edit AutoSelect property determines whether all the text in the edit control is automatically selected when the control gets focus. What we want is that AutoSelect works not only when the control is tabbed into BUT also when the edit control receives the input focus as a result of a mouse click into the control. Here's how.

Is Some (Delphi) TControl Under the Mouse?
Sometimes knowing what is the control directly under the mouse is not enough. Here's how to check if the mouse is over some Delphi TControl descendant even if is covered by its child controls.

Handling Mouse Wheel Messages For The TImage Delphi Control
TGraphicControl descendant controls do not receive mouse wheel messages in Delphi. TImage is one such control. Here's how to expose the OnMouseWheel event handler for the TImage Delphi control. What's more how to handle mouse wheel messages for any TControl descendant.

Loading XML / DTD in TXMLDocument - DTD Is Prohibited!
Delphi 2010 (and Delphi XE) uses MSXML 6 as the default DomVendor for the TXMLDocument. DomVendor (property) specifies the DOM implementation to...

©2014 About.com. All rights reserved.