Scalabium Software |
|
Knowledge for your independence'. | |
Home Delphi and C++Builder tips |
#34: How can I change alignment for TEdit |
|
Sometimes you need change the text alignment in standard TEdit
component. type TEditAlignment = class(TCustomEdit) protected { Protected declarations } procedure CreateParams(var Params: TCreateParams); override; end; procedure TEditAlignment.CreateParams(var Params: TCreateParams); const Alignments: array[TAlignment] of Longint = (ES_LEFT, ES_RIGHT, ES_CENTER); begin inherited CreateParams(Params); Params.Style := Params.Style or ES_MULTILINE or Alignments[FAlignment]; end; In Windows 98 you can set a Params.Style without ES_MULTILINE
flag and it too will work. PPS: You can download our freeware TTypedEdit
component with extended possibilities for control of user typing,
button in right side of edit, alignment and more
|
Copyright© 1998-2024, Scalabium
Software. All rights reserved. |