Hi
nimm eine ComboBox und füge als Items die zahlen 0 bis 4 ein. Style der ComboBox muss csOwnerDrawFixed sein.
Dann erstellst du eine Ereignisroutine für OnDrawItem:
Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20:
| procedure TfrmMain.cbxDrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState); begin with (Control as TcomboBox).Canvas do begin case Index of 0: Pen.Style := psSolid; 1: Pen.Style := psDash; 2: Pen.Style := psDot; 3: Pen.Style := psDashDot; 4: Pen.Style := psDashDotDot; end; if odSelected in State then Pen.Color := clHighLightText else Pen.Color := clWindowText; FillRect(rect); MoveTo(Rect.Left,Rect.Bottom - ((Rect.Bottom - Rect.Top) div 2)); LineTo(Rect.Right, Rect.Bottom - ((Rect.Bottom - Rect.Top) div 2)); end; end; |
Gruss Lothar
_________________
Der BH ist für die Brust, der Plan ist für'n Ar...