type  
PColorS7  =  ^TColorS7REC;  
TColorS7REC  =  record  
Light  :  WORD;  
Dark  :  WORD;  
Line  :  WORD;  
Fill  :  WORD;  
Font  :  WORD;  
end;  
 
type  
TTMStaticS7  =  class(TStaticText)  
private  
f_Length:  WORD;  
f_ColorS7:  TColorS7REC;    
published  
property  Length:  WORD  read  f_Length  write  f_Length;  
property  ColorS7:  TColorS7REC  read  f_ColorS7  write  f_ColorS7;  //在組件編輯器中設置該屬性  
end;  
 
procedure  TColorDesignEditor.ExecuteVerb(Index:  Integer);  
begin  
inherited;  
case  Index  of  
0:  begin  
f_DesignForm:=  TColorDesignForm.Create(application);  
try  
f_DesignForm.edtLight.Text:=  inttostr((Component  as  TTMStaticS7).ColorS7.Light);  
f_DesignForm.edtDark.Text:=  inttostr((Component  as  TTMStaticS7).ColorS7.Dark);  
f_DesignForm.edtLine.Text:=  inttostr((Component  as  TTMStaticS7).ColorS7.Line);  
f_DesignForm.edtFill.Text:=  inttostr((Component  as  TTMStaticS7).ColorS7.Fill);  
f_DesignForm.edtFont.Text:=  inttostr((Component  as  TTMStaticS7).ColorS7.Font);  
if  f_DesignForm.showModal  =  mrOK  then  
begin  
if  Component  is  TTMStaticS7  then  
begin  
(Component  as  TTMStaticS7).f_ColorS7.Light:=  strtoInt(f_DesignForm.edtLight.Text);  
(Component  as  TTMStaticS7).f_ColorS7.Dark:=  strtoInt(f_DesignForm.edtDark.Text);  
(Component  as  TTMStaticS7).f_ColorS7.Line:=  strtoInt(f_DesignForm.edtLine.Text);  
(Component  as  TTMStaticS7).f_ColorS7.Fill:=  strtoInt(f_DesignForm.edtFill.Text);  
(Component  as  TTMStaticS7).f_ColorS7.Font:=  strtoInt(f_DesignForm.edtFont.Text);  
end;  
{if  Component  is  then  
begin  
end;}  
end;  
finally  
f_DesignForm.Free;  
end;  
end;  
end;{case}  
end;