Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[MFC]怎樣讓ToolBar Enable或Disable?

0 views
Skip to first unread message

虛心請教

unread,
Jun 8, 2000, 3:00:00 AM6/8/00
to
[MFC]怎樣讓ToolBar Enable或Disable?

我用Doc, View架構,已經產生ToolBar了
ToolBar的兩個命令ID假設分別是ID_MyCommand_1, ID_MyCommand_2
當我開啟CMyView時,ToolBar就會因為有命令繞行,所以會被Enable

我想問的是,怎樣可以強迫ToolBar Enable或Disable
即現在因為某種原因,我不想讓使用者可以按ID_MyCommand_1
但是ID_MyCommand_2是可以按的

我的View Message如下

BEGIN_MESSAGE_MAP(CMyView, CView)
ON_COMMAND(ID_MyCommand_1, MyCommand_1)
ON_COMMAND(ID_MyCommand_2, MyCommand_2)
END_MESSAGE_MAP()

void CMyView::MyCommand_1()
{
// 因為某種原因,我不想讓使用者執行
}

void CMyView::MyCommand_2()
{
// Do something
}

請高手不吝指點
最好回到我的信箱
jms...@cadal.cse.nsysu.edu.tw

--
----== Posted via Openfind 網路論壇 ==-----
http://bbs.openfind.com.tw/ 提供免費的登載文章及查詢服務


虛心請教

unread,
Jun 8, 2000, 3:00:00 AM6/8/00
to
0 new messages