|
| How to draw an underline on a Listview Caption | 
|
|---|
Product: Delphi 3.x (or higher) | Category: Win API | Skill Level:
 | Scoring:  | Last Update: 04/08/2002 | Search Keys: delphi delphi3000 article borland vcl code-snippet Underline ListView API | Times Scored: 2 | Visits: 3204 | Uploader: Alex van der vliet Company: | Reference: N/A | | | Question/Problem/Abstract:
Can you underline the caption of a ListView Item? | Answer:
To draw an Underline on a Listview Caption the same like the HotTrack function in Delphi 6 in Delphi 3 you must call an API function.
In the Uses Clausse inpelement the CommCtrl unit.
Then you set the following code in the MouseMove property of your ListView.
procedure TfrmMain.lvwMainMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
const
LVS_EX_UNDERLINEHOT = $00000800;
var
AItem : TListItem;
Styles : DWord;
begin
AItem := lvwMain.GetItemAt(X, Y);
if not Assigned(AItem) then
begin
lvwMain.Cursor := crArrow;
end
else
begin
lvwMain.Cursor := crHandPoint;
Styles := Trunc(Styles + LVS_EX_UNDERLINEHOT - LVS_EX_CHECKBOXES - LVS_EX_FULLROWSELECT);
ListView_SetExtendedListViewStyle(lvwMain.Handle, Styles);
end;
end;
When you goes with your mouse over an ListView Item there will be an underline drawed under the caption of the Item.
|
|
|
| |
Sign up to consume product discounts for Bronze memberships !
|
|
| |
Community Ad of D. Wischnewski |
|
| |
|
|
|