nbsp; if FButtonDown then
begin
MoveTo(Left+1,Bottom-3);
LineTo(Left+1,Top+1);
LineTo(Right-2,Top+1);
end
else begin
MoveTo(Left+1,Bottom-2);
LineTo(Right-2,Bottom-2);
LineTo(Right-2,Top);
end;
end;
if Assigned(Glyph) then //如果关联了图片,则画
图片 begin
GlyphRect := BoundsRect;
GlyphRect.Right := GlyphRect.Right - 7;
GlyphRect.Bottom := GlyphRect.Bottom - 5;
if FButtonDown then
OffsetRect(GlyphRect,4,3)
else
OffsetRect(GlyphRect,3,2);
with GlyphRect do
StretchBlt(Handle, Left, Top, Right-Left, Bottom-Top,
FGlyph.Canvas.Handle, 0, 0, FGlyph.Width, FGlyph.Height, srcCopy);
end;
finally
ReleaseDC(FForm.Handle,Handle);
Free;
end;
end;
end;
procedure TTitleBarButton.Repaint;
begin
Paint;
end;
end.
另外,还可以对这个组件进一步扩展,扩展其它任一窗体,只要知道了窗体的Handle就行了。