ImageEn, unit iexCanvasUtils |
|
IEDrawGradientToComboListBoxItem
Declaration
procedure IEDrawGradientToComboListBoxItem(ControlCanvas: TCanvas;
CanvasRect: TRect;
ControlEnabled: Boolean;
GradientDir: TIEGDIPlusGradient;
FromColor, ToColor: TColor;
const Text: string);
Description
Draw a gradient to a combo box or list box
Note: Defined in iexCanvasUtils unit
// Note: mbGradient.Style = csOwnerDrawFixed, and ideally a big ItemHeight e.g. 40
// It is filled with the items of TIEGDIPlusGradient, i.e. "None" down to "Bottom Right"
procedure Tfmain.cmbGradientDrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState);
const
Grad_Color1 = clRed;
Grad_Color2 = clBlue;
begin
IEDrawGradientToComboListBoxItem( TComboBox( Control ).Canvas, Rect,
Control.Enabled,
TIEGDIPlusGradient( Index ),
Grad_Color1, Grad_Color2,
TComboBox( Control ).Items[ Index ]);
end;
See Also
◼GradientFillRect
◼IEDrawShapeToComboListBoxItem
◼IEDrawComboListBoxItem