1 頁 (共 1 頁)

如何在 TButton 上放置多行的 Caption

發表於 : 2008年 11月 27日, 16:58
tim
在 vcl 的 TButton 上要放置多行, 必須要先改變其 GWL_style 的屬性,
實作的方法則要使用 Window API 中的 SetWindowLong 和 GetWindowLong,
如下:

代碼: 選擇全部

    // TButton 可放置多行 caption 
    procedure SetMultiLineButton(abuttion: TButton); 
    var 
      ah: THandle; 
    begin 
      ah := abuttion.Handle; 
      SetWindowLong(ah, GWL_style, GetWindowLong(ah, GWL_style) OR BS_MULTILINE); 
    end;