Click here to Skip to main content
15,917,645 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: what is octet-stream? Pin
Daniel Turini22-Jan-03 1:17
Daniel Turini22-Jan-03 1:17 
QuestionButton without focus? Pin
Moak21-Jan-03 23:50
Moak21-Jan-03 23:50 
AnswerRe: Button without focus? Pin
chepuri_uk22-Jan-03 0:22
chepuri_uk22-Jan-03 0:22 
GeneralRe: Button without focus? Pin
Moak22-Jan-03 0:51
Moak22-Jan-03 0:51 
AnswerRe: Button without focus? Pin
xxhimanshu22-Jan-03 0:26
xxhimanshu22-Jan-03 0:26 
GeneralRe: Button without focus? Pin
Moak22-Jan-03 1:06
Moak22-Jan-03 1:06 
QuestionHow to Add an Event Handler for Toolbar Button in VC++7 Pin
Exceter21-Jan-03 23:37
Exceter21-Jan-03 23:37 
AnswerRe: How to Add an Event Handler for Toolbar Button in VC++7 Pin
xxhimanshu22-Jan-03 0:32
xxhimanshu22-Jan-03 0:32 
Wink | ;) hi,
do it like this!!!!!!!!!!!!!!
Open the header file for your view (double-click the class name in Class View), this is CDisableToolbarView in the example.

Okay; we need to write the declarations for our three functions; these would be as so:

afx_msg void OnToolbarButtonClick();

That's all we need in our header, so we can close that and open our cpp file.

For each of the three functions declared above, we need to create a function defintition like the one below.

void CToolbarView::OnToolbarButtonClick()
{
MessageBox("Red clicked");
}

Toward the top of the cpp file you will see a block of code starting with BEGIN_MESSAGE_MAP. Within these lines we can hook the click events up to our functions. Between the BEGIN_MESSAGE_MAP and END_MESSAGE_MAP lines, add the following three lines:

ON_BN_CLICKED(ID_TBRED,OnToolbarButtonClick)

thats it..

cheers


Himanshu
GeneralRe: How to Add an Event Handler for Toolbar Button in VC++7 Pin
Rage22-Jan-03 1:01
professionalRage22-Jan-03 1:01 
GeneralA question about the precompiled directive ASSERT Pin
George221-Jan-03 22:20
George221-Jan-03 22:20 
GeneralRe: A question about the precompiled directive ASSERT Pin
Rage21-Jan-03 22:28
professionalRage21-Jan-03 22:28 
GeneralRe: A question about the precompiled directive ASSERT Pin
George221-Jan-03 23:42
George221-Jan-03 23:42 
GeneralRe: A question about the precompiled directive ASSERT Pin
Rage22-Jan-03 0:01
professionalRage22-Jan-03 0:01 
GeneralRe: A question about the precompiled directive ASSERT Pin
George222-Jan-03 0:18
George222-Jan-03 0:18 
GeneralRe: A question about the precompiled directive ASSERT Pin
Rage22-Jan-03 0:52
professionalRage22-Jan-03 0:52 
GeneralRe: A question about the precompiled directive ASSERT Pin
Jörgen Sigvardsson22-Jan-03 3:28
Jörgen Sigvardsson22-Jan-03 3:28 
GeneralRe: A question about the precompiled directive ASSERT Pin
George222-Jan-03 15:37
George222-Jan-03 15:37 
GeneralRe: A question about the precompiled directive ASSERT Pin
Jörgen Sigvardsson22-Jan-03 21:58
Jörgen Sigvardsson22-Jan-03 21:58 
GeneralRe: A question about the precompiled directive ASSERT Pin
George223-Jan-03 15:55
George223-Jan-03 15:55 
Generalcopy user I/O (eg creating,modifing,reading a file or folder)to a fixed hidden directory Pin
rohit.dhamija21-Jan-03 22:17
rohit.dhamija21-Jan-03 22:17 
GeneralMouse shortcuts Pin
Rage21-Jan-03 21:59
professionalRage21-Jan-03 21:59 
GeneralRe: Mouse shortcuts Pin
HENDRIK R21-Jan-03 22:14
HENDRIK R21-Jan-03 22:14 
GeneralRe: Mouse shortcuts Pin
Rage21-Jan-03 22:35
professionalRage21-Jan-03 22:35 
GeneralRe: Mouse shortcuts Pin
HENDRIK R21-Jan-03 22:49
HENDRIK R21-Jan-03 22:49 
GeneralIAS Pin
Alireza_dcg21-Jan-03 21:39
sussAlireza_dcg21-Jan-03 21:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.