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

Вниз

Можно ли просто отцентрировать текст в 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;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.46 MB
Время: 0.011 c
1-69916
Val
2002-04-09 17:24
2002.04.22
inherited;


3-69755
EAlexander
2002-04-01 15:24
2002.04.22
DOA&ODAC


1-69918
ymin
2002-04-09 11:28
2002.04.22
А как сделать, чтобы Button была выделена и при нажатии Enter


14-69970
SV
2002-03-13 20:54
2002.04.22
Чайники на дорогах!


3-69668
Michael_Fehler
2002-04-03 12:20
2002.04.22
ADOQuery





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
Английский Французский Немецкий Итальянский Португальский Русский Испанский