定制控件的形状(TCustomControl)(6分)

D

delnus

Unregistered / Unconfirmed
GUEST, unregistred user!
我把TGraphicControl作为基类写的控件,可以运行时显示Circle,Ellipse,etc,能不
能从TCustomControl开始继承,开发一个 运行时显示多个形状的控件。我在写一个
TClock=Class(TCustomControl)
我想在运行时显示几种基本的形状,比如Circle,Rectangle,Ellipse,RoundRect,etc.
  Rectangle(x,y,w,h)究竟是如何实现的?
 
用CreateRoundRectRgn, CreateEllipticRgn,...等api生成一个Region, 然后SetWindowRgn(YourControl.Handle, Region, True)
 
顶部