Вниз
Скачать: CL | DM;

Как Caption на TButton написать в несколько строк ?   Найти похожие ветки 

 
PSZ   (2002-07-01 15:42) [0]

Сабж


 
Игорь Шевченко ©   (2002-07-01 15:46) [1]

BS_MULTILINE в CreateParams добавить к Style


 
PSZ   (2002-07-01 15:50) [2]

Если не затруднит - поподробнее.


 
Игорь Шевченко ©   (2002-07-01 15:57) [3]

Не затруднит :-)


//
// Кнопка с многострочной надписью. Строки разделяются символом |
//
{-----------------------------------------------------------------------------
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/MPL-1.1.html

Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the License for
the specific language governing rights and limitations under the License.

The Original Code is: JvAlignListbox.PAS, released on 2000-11-22.

The Initial Developer of the Original Code is Peter Below <100113.1101@compuserve.com>
Portions created by Peter Below are Copyright (C) 2000 Peter Below.
All Rights Reserved.

Contributor(s): ______________________________________.

Last Modified: 2000-mm-dd

You may retrieve the latest version of this file at the Project JEDI home page,
located at http://www.delphi-jedi.org

Known Issues:
-----------------------------------------------------------------------------}
{$A+,B-,C+,D+,E-,F-,G+,H+,I+,J+,K-,L+,M-,N+,O+,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y+,Z1}
{$I JEDI.INC}


unit JvMLButton;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;

// *** Important to include this constant showing your version #
const
TJvComponent_VERSION = "5.01";


type
TJvMultilineButton = class(Tbutton)
private
FMultiline: Boolean;
function GetCaption: String;
procedure SetCaption(const Value: String);
procedure SetMultiline(const Value: Boolean);
function GetAboutMe: string;
procedure SetAboutMe(const Value: string);
public
Procedure CreateParams( Var params: TCreateParams ); override;
Constructor Create( aOwner: TComponent ); override;
published
property AboutMe: string read GetAboutMe write SetAboutMe stored False;

property Multiline: Boolean read FMultiline write SetMultiline default True;
property Caption: String read GetCaption write SetCaption;
end;


implementation

{ TJvMultilineButton }

constructor TJvMultilineButton.Create(aOwner: TComponent);
begin
inherited;
FMultiline := True;
end;

procedure TJvMultilineButton.CreateParams(var params: TCreateParams);
begin
inherited;
If FMultiline Then
params.Style := params.Style or BS_MULTILINE;
end;

function TJvMultilineButton.GetAboutMe: string;
begin
Result := "Version: "+TJvComponent_VERSION;
end;

function TJvMultilineButton.GetCaption: String;
begin
Result := Stringreplace( inherited Caption, #13, "|", [rfReplaceAll] );
end;

procedure TJvMultilineButton.SetAboutMe(const Value: string);
begin

end;

procedure TJvMultilineButton.SetCaption(const Value: String);
begin
If value <> Caption Then Begin
inherited Caption := Stringreplace( value, "|", #13, [rfReplaceAll] );
Invalidate;
End;
end;

procedure TJvMultilineButton.SetMultiline(const Value: Boolean);
begin
If FMultiline <> Value Then Begin
FMultiline := Value;
RecreateWnd;
End;
end;

end.


 
PSZ   (2002-07-01 16:03) [4]

Спасибо



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.46 MB
Время: 0.044 c
14-47734
PycUS
2002-06-11 12:15
2002.07.15
SysTray


14-47673
Hypo
2002-06-14 20:58
2002.07.15
Чем отличается TQuery от TADOQuery ?


14-47705
nejest
2002-06-18 22:56
2002.07.15
Где достать книгу Исскуство Программирования Дональда Кнута


1-47505
goliaph
2002-07-04 12:37
2002.07.15
Мастера, помогите!!!! Горю. Ыспользование таймера.


1-47347
mihrutka
2002-07-01 15:41
2002.07.15
Удаление макровов из ворд документа




   Наверх