--- Mark Bracey <[EMAIL PROTECTED]> wrote:
> I've created derivative TEdits which respond to the CM_ENABLEDCHANGED
> message where I change the color to reflect it's enabled state.
>
FWIW, Mark, you can do this and it'll make every TEdit that you drop on the
form change without having to create a new control. This technique can be used
to override the behaviour in many of the std controls.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TEdit = class(StdCtrls.TEdit)
private
procedure CMEnabledChanged(var Message: TMessage); message
CM_ENABLEDCHANGED;
end;
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
{ TEdit }
procedure TEdit.CMEnabledChanged(var Message: TMessage);
begin
inherited;
if Enabled then
Color := clWindow
else
Color := clBtnFace;
end;
end.
This could also be used to override the painting of the non-client area for
repainting of the border by adding a WM_NCPAINT handler,
procedure WMNCPaint(var Message: TMessage); message WM_NCPAINT;
Not sure what it is exactly you want to do and I do not have Manifest installed
so I can't test this for you.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi-talk