Click here to Skip to main content
15,923,164 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Well. Can't you help me ? Pin
Rick York14-Nov-01 15:06
mveRick York14-Nov-01 15:06 
GeneralYou are Great , Rick !!! Manny thanks !!! Pin
mimi21-Nov-01 9:07
mimi21-Nov-01 9:07 
GeneralRe: Small and very simple thing Pin
Christian Graus14-Nov-01 14:52
protectorChristian Graus14-Nov-01 14:52 
GeneralRe: Small and very simple thing Pin
Nish Nishant14-Nov-01 16:25
sitebuilderNish Nishant14-Nov-01 16:25 
QuestionHow to draw flashing lines? Pin
hierro13-Nov-01 21:14
hierro13-Nov-01 21:14 
AnswerRe: How to draw flashing lines? Pin
Nish Nishant13-Nov-01 21:42
sitebuilderNish Nishant13-Nov-01 21:42 
GeneralHay....Guru...........See Me.....Help In Decision Pin
13-Nov-01 21:14
suss13-Nov-01 21:14 
QuestionHow to use GetToolBarCtrl().EnableButton? Pin
louis13-Nov-01 20:53
louis13-Nov-01 20:53 
I am trying to enable or disable a toolbar button during runtime without clicking on the toolbar itself.
When a condition in some other file changes I would like to toggle the toolbar button accordingly.
The OnUpdateHandler that the Wizard uses does seem to update.

I am using the CToolbar::GetToolbarCtrl() and
CToolbarCtrl::EnableButton(nID, FALSE) because I'm working in different files, calling a function in CMainFrame.

However, the return value from EnableButton is FALSE. Why is this??

Can anyone please tell me what I am doing wrong???

m_MyToolbar is the CToolbar object which successfully has loaded my toolbar in my application. Now I just want to enable/disable a button on this toolbar...


file_A.cpp

void function file_A ()
{
cMainFrame MainFrame;
....
....
int nSuccess = MainFrame.m_MyToolbar.GetToolbarCtrl().EnableButton(ID_BUT1,FALSE);
...
...
}


Any help appreciated..! Thank you.



Frown | :( Frown | :( Smile | :)
AnswerRe: How to use GetToolBarCtrl().EnableButton? Pin
Nish Nishant13-Nov-01 21:39
sitebuilderNish Nishant13-Nov-01 21:39 
GeneralRe: How to use GetToolBarCtrl().EnableButton? Pin
louis13-Nov-01 22:07
louis13-Nov-01 22:07 
GeneralRe: How to use GetToolBarCtrl().EnableButton? Pin
Nish Nishant13-Nov-01 22:33
sitebuilderNish Nishant13-Nov-01 22:33 
GeneralRe: How to use GetToolBarCtrl().EnableButton? Pin
louis13-Nov-01 22:40
louis13-Nov-01 22:40 
AnswerRe: How to use GetToolBarCtrl().EnableButton? Pin
Michael Dunn13-Nov-01 22:03
sitebuilderMichael Dunn13-Nov-01 22:03 
GeneralRe: How to use GetToolBarCtrl().EnableButton? Pin
louis13-Nov-01 22:42
louis13-Nov-01 22:42 
GeneralInput box Pin
David Fleming13-Nov-01 20:04
David Fleming13-Nov-01 20:04 
GeneralRe: Input box Pin
Nish Nishant13-Nov-01 20:21
sitebuilderNish Nishant13-Nov-01 20:21 
GeneralRe: Input box Pin
David Fleming13-Nov-01 20:25
David Fleming13-Nov-01 20:25 
GeneralRe: Input box Pin
Nish Nishant13-Nov-01 21:29
sitebuilderNish Nishant13-Nov-01 21:29 
GeneralRe: Input box Pin
David Fleming14-Nov-01 8:26
David Fleming14-Nov-01 8:26 
GeneralRe: Input box Pin
Nish Nishant14-Nov-01 17:02
sitebuilderNish Nishant14-Nov-01 17:02 
GeneralRe: Input box Pin
PJ Arends13-Nov-01 22:11
professionalPJ Arends13-Nov-01 22:11 
GeneralRe: Input box Pin
David Fleming14-Nov-01 9:19
David Fleming14-Nov-01 9:19 
GeneralTemplates and Unresolved Externals Pin
Xavier Shay13-Nov-01 19:51
Xavier Shay13-Nov-01 19:51 
GeneralRe: Templates and Unresolved Externals Pin
Oliver Anhuth13-Nov-01 21:31
Oliver Anhuth13-Nov-01 21:31 
GeneralRe: Templates and Unresolved Externals Pin
Xavier Shay13-Nov-01 22:43
Xavier Shay13-Nov-01 22:43 

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.