線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:1259
推到 Plurk!
推到 Facebook!

記錄使用過的檔案名稱

答題得分者是:axsoft
crop
一般會員


發表:33
回覆:9
積分:8
註冊:2004-07-05

發送簡訊給我
#1 引用回覆 回覆 發表時間:2006-07-10 16:40:25 IP:140.122.xxx.xxx 訂閱

大家好..

Word會將前幾次開啟的檔案名稱記錄在 檔案(F) 底下,

請問在BCB下該如何做出類似的功能呢??

謝謝....

GGL
資深會員


發表:104
回覆:600
積分:335
註冊:2006-11-05

發送簡訊給我
#2 引用回覆 回覆 發表時間:2006-07-10 18:00:15 IP:140.118.xxx.xxx 未訂閱
Word是利用Register的方式,你也可以透過ini的方式...都可以達到這個效果
axsoft
版主


發表:681
回覆:1056
積分:969
註冊:2002-03-13

發送簡訊給我
#3 引用回覆 回覆 發表時間:2006-07-20 19:46:14 IP:61.219.xxx.xxx 未訂閱
How can I add items to the system menu?


When I click on my form's border icon, a popup system menu appears. How can I add items to this menu and handle their OnClick event?

e007.gif

1.
Start a new project using File | New Application.
2.
Add a Button. Edit its OnClick event:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
HMENU menu = GetSystemMenu(Handle, false);
if(menu)
{
// Add separator
AppendMenu(menu, MF_SEPARATOR, NULL, NULL);
// Add menu item
AppendMenu(menu, MF_STRING, 555, "Click here...");
}
}
3.
Open your header file:
private:
MESSAGE void __fastcall ClickHere(TMessage &);
BEGIN_MESSAGE_MAP
MESSAGE_HANDLER(WM_SYSCOMMAND, TMessage, ClickHere);
END_MESSAGE_MAP(TForm);
4.
Insert in your source code:
void __fastcall TForm1::ClickHere(TMessage &Message)
{
if(Message.WParam == 555)
{
ShowMessage("You clicked me!");
}
TForm::Dispatch(&Message);
}


C Builder Developer's Network
Copyright c Yoto Yotov

axsoft
版主


發表:681
回覆:1056
積分:969
註冊:2002-03-13

發送簡訊給我
#4 引用回覆 回覆 發表時間:2006-07-20 19:49:27 IP:61.219.xxx.xxx 未訂閱

How can I insert items at run-time?


1.
Start a new project using File | New Application.
2.
Add a Menu. Don't insert any items.
3.
Double-click the OnShow event of your form:
void __fastcall TForm1::FormShow(TObject *Sender)
{
TMenuItem* item = new TMenuItem(MainMenu1);
item->Caption = "New";
item->OnClick = NewClick;
MainMenu1->Items->Add(item);
}
4.
Open your header file:
private:
void __fastcall NewClick(TObject *);
5.
Insert in your source code:
void __fastcall TForm1::NewClick(TObject *Sender)
{
ShowMessage("You clicked me!");
}

C Builder Developer's Network
Copyright c Yoto Yotov

<!-- BEGIN PROBE CODE -->

axsoft
版主


發表:681
回覆:1056
積分:969
註冊:2002-03-13

發送簡訊給我
#5 引用回覆 回覆 發表時間:2006-07-20 19:50:20 IP:61.219.xxx.xxx 未訂閱
How can I delete menu items at run-time?


1.
Start a new project using File | New Application.
2.
Add a Menu. Insert two menu items: First and Second.
3.
Edit the OnShow event of your form:
void __fastcall TForm1::FormCreate(TObject *Sender)
{
MainMenu1->Items->Delete(0);
}
When the program is executed, First should not be visible. You can also delete subitems using MainMenu1->Items->Items[0]->Delete(0);
C Builder Developer's Network
Copyright c Yoto Yotov
axsoft
版主


發表:681
回覆:1056
積分:969
註冊:2002-03-13

發送簡訊給我
#6 引用回覆 回覆 發表時間:2006-07-20 19:52:59 IP:61.219.xxx.xxx 未訂閱

How can I add images to my menu?




1.
Start a new project using File | New Application.
2.
Add a Menu. Insert the items File | New.
3.
Add two (2) Images. Load a small bitmap in each one of
them.
4.
Edit the OnShow event of your form:
void __fastcall TForm1::FormShow(TObject *Sender)
{
SetMenuItemBitmaps(MainMenu1->Handle, New1->
Command, MF_BYCOMMAND, Image1->Picture->
Bitmap->Handle, Image2->Picture->Bitmap->
Handle);
}
5.
Double-click the OnClick event of the New menu item:
void __fastcall TForm1::New1Click(TObject *Sender)
{
if(New1->Checked)
New1->Checked = false;
else
New1->Checked = true;
}
<!-- BEGIN PROBE CODE -->
系統時間:2024-04-28 18:08:08
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!