Unit1.cpp
上传用户:lulishicai
上传日期:2010-03-01
资源大小:13202k
文件大小:2k
源码类别:
Delphi/CppBuilder
开发平台:
C++ Builder
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #pragma hdrstop
- #include "Unit1.h"
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma link "SHDocVw_OCX"
- #pragma resource "*.dfm"
- TForm1 *Form1;
- //---------------------------------------------------------------------------
- __fastcall TForm1::TForm1(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //---------------------------------------------------------------------------
- //响应"连接"按钮
- void __fastcall TForm1::connectClick(TObject *Sender)
- {
- OleVariant a,b,c,d;
- WideString str;
- str=Edit1->Text;
- WebBrowser1->Navigate(str,a,b,c,d);
- }
- //---------------------------------------------------------------------------
- //响应"前进"按钮
- void __fastcall TForm1::Button2Click(TObject *Sender)
- {
- WebBrowser1->GoForward();
- }
- //---------------------------------------------------------------------------
- //响应"后退"按钮
- void __fastcall TForm1::Button3Click(TObject *Sender)
- {
- WebBrowser1->GoBack();
- }
- //---------------------------------------------------------------------------
- //响应"主页"按钮
- void __fastcall TForm1::Button4Click(TObject *Sender)
- {
- WebBrowser1->GoHome();
- }
- //---------------------------------------------------------------------------
- //响应"刷新"按钮
- void __fastcall TForm1::Button5Click(TObject *Sender)
- {
- WebBrowser1->Refresh();
- }
- //---------------------------------------------------------------------------
- //响应"停止"按钮
- void __fastcall TForm1::Button6Click(TObject *Sender)
- {
- WebBrowser1->Stop();
- WebBrowser1->GoHome();
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Edit1KeyPress(TObject *Sender, char &Key)
- {
- if(Key==13)
- connectClick(Sender);
- }
- //---------------------------------------------------------------------------