📄 informationbrowall.~cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "InformationBrowAll.h"
#include <jpeg.hpp>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TAllBrowseForm *AllBrowseForm;
//---------------------------------------------------------------------------
__fastcall TAllBrowseForm::TAllBrowseForm(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TAllBrowseForm::FormCreate(TObject *Sender)
{
AnsiString selfPath = ExtractFilePath( Application->ExeName );
AnsiString xianshi=selfPath+"\\"+"Browse.jpg";
if( xianshi.IsEmpty() )
return;
Graphics::TBitmap *pBitmap = new Graphics::TBitmap();
TJPEGImage *pJpg = new TJPEGImage();
try
{
if(FileExists (xianshi) )
{
pJpg->LoadFromFile(xianshi);
pBitmap->Assign(pJpg);
Image1->Canvas->StretchDraw(Image1->ClientRect , pBitmap);
}
}
__finally
{
delete pBitmap;
delete pJpg;
}
}
//---------------------------------------------------------------------------
void __fastcall TAllBrowseForm::BitBtn1Click(TObject *Sender)
{
AnsiString NewStr="请输入需要的记录数";
if(ADOTableInfoAll->RecordCount>0)
{
if(InputQuery("记录定位对话框","定位记录",NewStr))
{
if(StrToInt(NewStr)>ADOTableInfoAll->RecordCount)
{
Application->MessageBox(AnsiString( "输入的记录数超出数据库记录数!").c_str(), "提示", MB_OK);
return ;
}
else
ADOTableInfoAll->RecNo=StrToInt(NewStr);
//StatusBarMain->Panels->Items[0]->Text ="第 " + String (TableSpdCarInfo->RecNo) + " / " + String(TableSpdCarInfo->RecordCount) + "个记录";
}
StatusBar1->Panels->Items[0]->Text =" 第 " + String (ADOTableInfoAll->RecNo) + " / " + String(ADOTableInfoAll->RecordCount) + "个记录";
}
else
{}
}
//---------------------------------------------------------------------------
void __fastcall TAllBrowseForm::FormClose(TObject *Sender,
TCloseAction &Action)
{
ADOTableInfoAll->Close();
}
//---------------------------------------------------------------------------
void __fastcall TAllBrowseForm::FormShow(TObject *Sender)
{
ADOTableInfoAll->Active=true;
if ( ADOTableInfoAll->RecordCount > 0 )
ADOTableInfoAll->Last();
StatusBar1->Panels->Items[0]->Text =" 第 " + String (ADOTableInfoAll->RecNo) + " / " + String(ADOTableInfoAll->RecordCount) + "个记录";
}
//---------------------------------------------------------------------------
void __fastcall TAllBrowseForm::DBNavigator1Click(TObject *Sender,
TNavigateBtn Button)
{
switch (Button)
{
case nbFirst:
StatusBar1->Panels->Items[0]->Text =" 第 " + String (ADOTableInfoAll->RecNo) + " / " + String(ADOTableInfoAll->RecordCount) + "个记录";
break;
case nbPrior:
StatusBar1->Panels->Items[0]->Text =" 第 " + String (ADOTableInfoAll->RecNo) + " / " + String(ADOTableInfoAll->RecordCount) + "个记录";
break;
case nbNext:
StatusBar1->Panels->Items[0]->Text =" 第 " + String (ADOTableInfoAll->RecNo) + " / " + String(ADOTableInfoAll->RecordCount) + "个记录";
break;
case nbLast:
StatusBar1->Panels->Items[0]->Text =" 第 " + String (ADOTableInfoAll->RecNo) + " / " + String(ADOTableInfoAll->RecordCount) + "个记录";
break;
}
}
//---------------------------------------------------------------------------
void __fastcall TAllBrowseForm::DBGrid1CellClick(TColumn *Column)
{
StatusBar1->Panels->Items[0]->Text =" 第 " + String (ADOTableInfoAll->RecNo) + " / " + String(ADOTableInfoAll->RecordCount) + "个记录";
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -