uses StdCtrls, Mask, DBCtrls, Grids, DBGrids,extctrls, dbcgrids,
CheckLst ;
public
procedure CMfocuschanged(var message: TCMfocuschanged); message CM_Focuschanged;
procedure Tform1.CMFocusChanged(var Message: TCMFocusChanged);
var
i:integer;
grenk,crenk : tcolor;
BEGIN
grenk := clwhite;
crenk := clred;
if (message.sender is tedit) or
(message.sender is tcombobox) or
(message.sender is tlistbox) or
(message.sender is tcheckbox) or
(message.sender is tradiobutton) or
(message.sender is tdbedit)or
(message.sender is tdbcombobox) or
(message.sender is tdblistbox) or
(message.sender is tdbcheckbox) or
(message.sender is TMemo) or
(message.sender is TDBMemo) or
(message.sender is TDBGrid) or
(message.sender is TMaskEdit) or
(message.sender is TStringGrid) or
(message.sender is TDrawGrid) or
(message.sender is TCheckListBox) or
(message.sender is TDBRichEdit) or
(message.sender is TDBLookupListBox) or
(message.sender is TDBLookupComboBox)
then
begin
for i:=0 to componentcount-1 do
begin
if components[i] is tedit then
tedit(components[ i ]).color:= grenk;
if components[i] is tcombobox then
tcombobox(components[i]).color:= grenk;
if components[i] is tlistbox then
tlistbox(components[i]).color:= grenk;
if components[i] is tcheckbox then
tcheckbox(components[i]).color := grenk;
if components[i] is tradiobutton then
tradiobutton(components[i]).color:= grenk;
if components[i] is tdbedit then
tdbedit(components[i]).color:= grenk;
if components[i] is tdbcombobox then
tdbcombobox(components[i]).color:= grenk;
if components[i] is tdblistbox then
tdblistbox(components[i]).color:= grenk;
if components[i] is tdbcheckbox then
tdbcheckbox(components[i]).color:= grenk;
if components[i] is TMemo then
TMemo(components[i]).color:= grenk;
if components[i] is TDBMemo then
TDBMemo(components[i]).color:= grenk;
if components[i] is TDBGrid then
TDBGrid(components[i]).color:= grenk;
if components[i] is TMaskEdit then
TMaskEdit(components[i]).color:= grenk;
if components[i] is TStringGrid then
TStringGrid(components[i]).color:= grenk;
if components[i] is TDrawGrid then
TDrawGrid(components[i]).color:= grenk;
if components[i] is TCheckListBox then
TCheckListBox(components[i]).color:= grenk;
if components[i] is TDBRichEdit then
TDBRichEdit(components[i]).color:= grenk;
if components[i] is TDBLookupListBox then
TDBLookupListBox(components[i]).color:= grenk;
if components[i] is TDBLookupComboBox then
TDBLookupComboBox(components[i]).color:= grenk;
end ;
tedit(message.sender).color:=crenk;
end
end;
//masus......