?? customserach.cpp
字號:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "CustomSerach.h"
#include "DataMoudle.h"
#include "Main.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TCustomSearchForm *CustomSearchForm;
//---------------------------------------------------------------------------
__fastcall TCustomSearchForm::TCustomSearchForm(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TCustomSearchForm::BtnSearchClick(TObject *Sender)
{
if(RadioButton1->Checked == true)
{
ADOQueryTemp->Active = false;
ADOQueryTemp->SQL->CommaText="select * from custom where name="+QuotedStr(ComboBox1->Text);
ADOQueryTemp->Active = true;
}
if(RadioButton2->Checked == true)
{
ADOQueryTemp->Active = false;
ADOQueryTemp->SQL->CommaText = "select * from custom where Province="+QuotedStr(ComboBox1->Text);
ADOQueryTemp->Active = true;
}
}
//---------------------------------------------------------------------------
void __fastcall TCustomSearchForm::FormClose(TObject *Sender,
TCloseAction &Action)
{
Action = caFree;
MainForm->CustomSearch = 0;
}
//---------------------------------------------------------------------------
void __fastcall TCustomSearchForm::RadioButton2Click(TObject *Sender)
{
ADOQueryPro->Active = true;
while ( !ADOQueryPro->Eof )
{
ComboBox1->Items->Add( ADOQueryPro->FieldByName( "Province" )->AsString );
ADOQueryPro->Next();
}
ADOQueryPro->Active = false;
}
//---------------------------------------------------------------------------
void __fastcall TCustomSearchForm::RadioButton1Click(TObject *Sender)
{
ComboBox1->Items->Clear();
}
//---------------------------------------------------------------------------
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -