?? u6_8_1.cpp
字號:
//------------------- u6_8_1 --------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "u6_8_1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
Tf6_8_1 *f6_8_1;
//---------------------------------------------------------------------------
__fastcall Tf6_8_1::Tf6_8_1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
float speed;
void __fastcall Tf6_8_1::FormActivate(TObject *Sender)
{
imgCar->Picture->LoadFromFile("D:\\ch06\\c6_8_1\\Cars.bmp");
hsbSpeed->Position=500;
speed=hsbSpeed->Position/1000.0;
tmrSpeed->Interval=hsbSpeed->Position;
}
//---------------------------------------------------------------------------
void __fastcall Tf6_8_1::tmrSpeedTimer(TObject *Sender)
{
imgCar->Left=imgCar->Left+10;
if (imgCar->Left>=Width)
{
imgCar->Left=-Width;
}
}
//---------------------------------------------------------------------------
void __fastcall Tf6_8_1::hsbSpeedChange(TObject *Sender)
{
speed=((hsbSpeed->Position)/1000);
tmrSpeed->Interval=hsbSpeed->Position;
}
//---------------------------------------------------------------------------
void __fastcall Tf6_8_1::btnEndClick(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -