Unit1.cpp
上传用户:lhxd_sz
上传日期:2014-10-02
资源大小:38814k
文件大小:3k
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #pragma hdrstop
- #include "Unit1.h"
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma resource "*.dfm"
- TForm1 *Form1;
- //---------------------------------------------------------------------------
- __fastcall TForm1::TForm1(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Test(TObject *Sender)
- {
- int ii;
- TLabel *lb;
- AnsiString ss1,ss2;
- ss1=Sender->ClassName();
- if(ss1!="TLabel")return;
- lb=(TLabel*)Sender;
- ss1=lb->Name;
- for(ii=0;ii<ControlCount;ii++)
- {
- lb=(TLabel *)Controls[ii];
- ss2=lb->Name;
- if(ss1==ss2)
- lb->Font->Color=clRed;
- else
- lb->Font->Color=clBlack;
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Label1MouseMove(TObject *Sender, TShiftState Shift,
- int X, int Y)
- {
- Test(Sender);
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Label2MouseMove(TObject *Sender, TShiftState Shift,
- int X, int Y)
- {
- Test(Sender);
-
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Label3MouseMove(TObject *Sender, TShiftState Shift,
- int X, int Y)
- {
- Test(Sender);
-
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Label4MouseMove(TObject *Sender, TShiftState Shift,
- int X, int Y)
- {
- Test(Sender);
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Label5MouseMove(TObject *Sender, TShiftState Shift,
- int X, int Y)
- {
- Test(Sender);
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Label6MouseMove(TObject *Sender, TShiftState Shift,
- int X, int Y)
- {
- Test(Sender);
-
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Label7MouseMove(TObject *Sender, TShiftState Shift,
- int X, int Y)
- {
- Test(Sender);
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Label8MouseMove(TObject *Sender, TShiftState Shift,
- int X, int Y)
- {
- Test(Sender);
-
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Label9MouseMove(TObject *Sender, TShiftState Shift,
- int X, int Y)
- {
- Test(Sender);
-
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Label10MouseMove(TObject *Sender,
- TShiftState Shift, int X, int Y)
- {
- Test(Sender);
- }
- //---------------------------------------------------------------------------