Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2002.04.22;
Скачать: CL | DM;

Вниз

Можно ли просто отцентрировать текст в EDIT?   Найти похожие ветки 

 
UDS ©   (2002-04-07 20:38) [0]

Понятно, что в мемо это сделать проще, а можно ли все-таки расположить по центру текст в EDIT?


 
Song ©   (2002-04-07 20:42) [1]

Отцентрировать пробелами


 
UDS ©   (2002-04-07 20:50) [2]

Такая мыль была. Но тогда надо в программе каждый раз учитывать эти пробелы.


 
Song ©   (2002-04-07 20:56) [3]

И что страшно?


 
UDS ©   (2002-04-07 21:01) [4]

Да вот ты знаешь у меня тут едитов уже около 70-ти и ещё пару раз по столько примерно намечается...


 
Song ©   (2002-04-08 08:13) [5]

Напиши общий обработчик для всех.


 
Игорь Шевченко ©   (2002-04-08 18:14) [6]

День добрый,

//
// Edit с заданным выравниванием текста
//
{-----------------------------------------------------------------------------
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 JvAlignedEdit;

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
TJvAlignedEdit = class(TEdit)
private
fAlignment: TAlignment;
procedure SetAlignment(const Value: TAlignment);
procedure WMGetDlgCode(var Message: TWMGetDlgCode); message WM_GETDLGCODE;
procedure WMChar( Var Message: TMessage ); Message WM_CHAR;
function GetAboutMe: string;
procedure SetAboutMe(const Value: string);
{ Private declarations }
protected
{ Protected declarations }
Procedure CreateParams( Var params: TCreateParams ); override;
public
{ Public declarations }
published
{ Published declarations }
property AboutMe: string read GetAboutMe write SetAboutMe stored False;

property Alignment: TAlignment read fAlignment write SetAlignment
default taLeftJustify;
end;

implementation


{ TJvAlignedEdit }

procedure TJvAlignedEdit.CreateParams(var params: TCreateParams);
const
Styles : Array [TAlignment] of DWORD =
(ES_LEFT, ES_RIGHT, ES_CENTER );
begin
inherited;
params.style := params.style or Styles[ Falignment ] or
ES_MULTILINE * DWORD(Ord( FAlignment <> taLeftJustify));
end;

procedure TJvAlignedEdit.SetAlignment(const Value: TAlignment);
begin
If fAlignment <> Value Then Begin
fAlignment := Value;
RecreateWnd;
End;
end;

procedure TJvAlignedEdit.WMGetDlgCode(var Message: TWMGetDlgCode);
begin
inherited;
Message.Result := Message.Result and not DLGC_WANTALLKEYS;
end;

procedure TJvAlignedEdit.WMChar(var Message: TMessage);
var
f: TForm;
begin
If Message.wparam = 13 Then Begin
f:= TForm(GetParentForm( self ));
If Assigned(f) Then
f.Perform( CM_DIALOGKEY, VK_RETURN, message.lparam );
End
Else
inherited;
end;


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

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

end;

end.

С уважением,


 
Дмитрий Баранов   (2002-04-08 18:51) [7]

MSDN->Edit control->ES_CENTER message



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

Текущий архив: 2002.04.22;
Скачать: CL | DM;

Наверх




Память: 0.48 MB
Время: 0.013 c
1-69838
DeMoN-777
2002-04-11 04:14
2002.04.22
ListBox


6-69952
Dimk
2002-02-08 22:51
2002.04.22
Как в виндах определить все сокеты и какими процессами они открыты?


1-69815
VEG
2002-04-10 01:05
2002.04.22
Работа с ресурсами другого exe-шника.


14-69974
lipskiy
2002-03-13 04:10
2002.04.22
И когда это вы все всё успеваете?


1-69813
voland0
2002-04-10 17:10
2002.04.22
Очень нужно, помогите! Как