Click here to Skip to main content
16,007,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: about ToolBar Pin
BigMouth12-Dec-01 1:47
BigMouth12-Dec-01 1:47 
GeneralRe: about ToolBar Pin
Christian Graus12-Dec-01 10:27
protectorChristian Graus12-Dec-01 10:27 
GeneralRe: about ToolBar Pin
BigMouth12-Dec-01 18:41
BigMouth12-Dec-01 18:41 
GeneralRe: about ToolBar Pin
Christian Graus12-Dec-01 18:52
protectorChristian Graus12-Dec-01 18:52 
GeneralRe: about ToolBar Pin
BigMouth13-Dec-01 20:13
BigMouth13-Dec-01 20:13 
GeneralRe: about ToolBar Pin
Christian Graus14-Dec-01 10:23
protectorChristian Graus14-Dec-01 10:23 
GeneralRe: about ToolBar Pin
BigMouth14-Dec-01 18:23
BigMouth14-Dec-01 18:23 
GeneralRe: about ToolBar Pin
Christian Graus15-Dec-01 10:56
protectorChristian Graus15-Dec-01 10:56 
Sure - this is how you'd add a button with the bitmap we've been putting into the image list, which calls OnFileNew:

int index = m_wndToolBar.GetToolBarCtrl().GetImageList()->Add(AfxGetApp()->LoadIcon(IDR_MAINFRAME));
TBBUTTON btn;
btn.fsStyle = TBBUTTON;
btn.fsState = TBSTATE_ENABLED;
btn.idCommand = ID_FILE_NEW;
btn.iBitmap = index;

m_wndToolbar.GetToolBarCtrl().AddButtons(1, &btn);


Note we store the index of the image and pass it to the button, and we pass in the ID of the command we want the button to execute.


Christian

After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001

Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now

GeneralRe: about ToolBar Pin
BigMouth15-Dec-01 21:01
BigMouth15-Dec-01 21:01 
GeneralRe: about ToolBar Pin
Christian Graus16-Dec-01 9:51
protectorChristian Graus16-Dec-01 9:51 
GeneralRe: about ToolBar Pin
BigMouth16-Dec-01 17:59
BigMouth16-Dec-01 17:59 
GeneralRe: about ToolBar Pin
Christian Graus17-Dec-01 10:01
protectorChristian Graus17-Dec-01 10:01 
GeneralRe: about ToolBar Pin
BigMouth18-Dec-01 17:21
BigMouth18-Dec-01 17:21 
GeneralRe: about ToolBar Pin
Christian Graus18-Dec-01 17:31
protectorChristian Graus18-Dec-01 17:31 
GeneralRe: about ToolBar Pin
BigMouth18-Dec-01 21:52
BigMouth18-Dec-01 21:52 
GeneralRe: about ToolBar Pin
Christian Graus19-Dec-01 0:59
protectorChristian Graus19-Dec-01 0:59 
GeneralRe: about ToolBar Pin
BigMouth21-Dec-01 23:49
BigMouth21-Dec-01 23:49 
GeneralRe: about ToolBar Pin
BigMouth21-Dec-01 23:55
BigMouth21-Dec-01 23:55 
GeneralRe: about ToolBar Pin
Christian Graus22-Dec-01 12:53
protectorChristian Graus22-Dec-01 12:53 
GeneralRe: about ToolBar Pin
BigMouth22-Dec-01 21:35
BigMouth22-Dec-01 21:35 
GeneralRe: about ToolBar Pin
Christian Graus23-Dec-01 10:20
protectorChristian Graus23-Dec-01 10:20 
GeneralRe: about ToolBar Pin
BigMouth24-Dec-01 2:41
BigMouth24-Dec-01 2:41 
GeneralDialog Box Problem Pin
mvworld11-Dec-01 22:42
mvworld11-Dec-01 22:42 
GeneralRe: Dialog Box Problem Pin
Joaquín M López Muñoz12-Dec-01 1:28
Joaquín M López Muñoz12-Dec-01 1:28 
GeneralRe: Dialog Box Problem Pin
mvworld12-Dec-01 1:35
mvworld12-Dec-01 1:35 

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.