你参考Tbutton就可以了。有没有更好的方法? 老兄,你不会是想超过Borland的开发工程师吧?

解决方案 »

  1.   

    不是啊! 怎么画button ,Tbutton的继承关系太复杂了,就是从
    TWincontrol写一个button控件,大家可以写以下试试吗?
      

  2.   

    这是d6中关于TControl类的说明。
    Specifies a text string that identifies the control to the user.
    property Caption: TCaption;
    Description
    Use Caption to specify the text string that labels the control.
    To underline a character in a Caption that labels a component, include an ampersand (&) before the character. This type of character is called an accelerator character. The user can then select the component by pressing Alt while typing the underlined character. To display an ampersand character in the caption, use two ampersands (&&).
    Note: Controls that display text use either the Caption property or the Text property to specify the text value. Which property is used depends on the type of control. In general, Caption is used for text that appears as a window title or label, while Text is used for text that appears as the content of a control.
    这些是关于published的帮助文档,组件设计期的特征应该是写在published部分的
    Published members have the same visibility as public members. The difference is that runtime type information (RTTI) is generated for published members. RTTI allows an application to query the fields and properties of an object dynamically and to locate its methods. RTTI is used to access the values of properties when saving and loading form files, to display properties in the Object Inspector, and to associate specific methods (called event handlers) with specific properties (called events).Published properties are restricted to certain data types. Ordinal, string, class, interface, and method-pointer types can be published. So can set types, provided the upper and lower bounds of the base type have ordinal values between 0 and 31. (In other words, the set must fit in a byte, word, or double word.) Any real type except Real48 can be published. Properties of an array type (as distinct from array properties, discussed below) cannot be published.Some properties, although publishable, are not fully supported by the streaming system. These include properties of record types, array properties of all publishable types, and properties of enumerated types that include anonymous values. If you publish a property of this kind, the Object Inspector won抰 display it correctly, nor will the property抯 value be preserved when objects are streamed to disk.
    All methods are publishable, but a class cannot publish two or more overloaded methods with the same name. Fields can be published only if they are of a class or interface type.A class cannot have published members unless it is compiled in the {$M+} state or descends from a class compiled in the {$M+} state. Most classes with published members derive from TPersistent, which is compiled in the {$M+} state, so it is seldom necessary to use the $M directive.
    比较懒惰,没有去细看,希望能够对你有所帮助!