Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Основная";
Текущий архив: 2002.07.15;
Скачать: [xml.tar.bz2];

Вниз

Как 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 вся ветка

Форум: "Основная";
Текущий архив: 2002.07.15;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.46 MB
Время: 0.012 c
1-47353
nimble
2002-07-01 07:26
2002.07.15
ComboBox - Цвет


4-47896
zam
2002-05-15 20:36
2002.07.15
Подскажите, как пользоваться winapi ф-ей ReadFile???


1-47534
Leny
2002-06-25 08:34
2002.07.15
Запуск программы из Delphi


3-47118
MikeFW
2002-06-21 10:31
2002.07.15
Проблемы со скоростью обработки TQuery записей из базы данных


3-47141
LevVL
2002-06-24 16:20
2002.07.15
Вопрос для специалистов в области SQL для





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский