Click here to Skip to main content
15,903,854 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Creating a dialog when a user hits ctrl+g+d Pin
Maximilien8-Aug-03 8:47
Maximilien8-Aug-03 8:47 
GeneralRe: Creating a dialog when a user hits ctrl+g+d Pin
keegan8-Aug-03 9:00
keegan8-Aug-03 9:00 
GeneralRe: Creating a dialog when a user hits ctrl+g+d Pin
David Crow8-Aug-03 9:36
David Crow8-Aug-03 9:36 
GeneralRe: Creating a dialog when a user hits ctrl+g+d Pin
Richard Jones8-Aug-03 9:57
Richard Jones8-Aug-03 9:57 
GeneralRe: Creating a dialog when a user hits ctrl+g+d Pin
keegan8-Aug-03 10:04
keegan8-Aug-03 10:04 
GeneralRe: Creating a dialog when a user hits ctrl+g+d Pin
David Crow8-Aug-03 11:03
David Crow8-Aug-03 11:03 
GeneralClick and Double Click recognition Pin
Muhammad Basim8-Aug-03 8:00
sussMuhammad Basim8-Aug-03 8:00 
GeneralAdding bitmap to a CImageList object Pin
AJOsborne8-Aug-03 5:45
AJOsborne8-Aug-03 5:45 
I am having touble developing a MFC project to switch images on tool bar buttons. First I can not get the following code to display predefined bitmap images in the toolbar.

The desired result of this code is, of course, to produce the desired images on the tool bar and then have the images switch as the tool bar button is toggled... the toggling code will be implimented in an OnUpdateUI handler which is another part of this project.

The updating code will look something like this...

void CMainFrame::OnUpdateSwitch_134(CCmdUI* pCmdUI)
{
m_bSwitch134 = !m_bSwitch134;

if( m_bSwitch134)
SwitchToolBar.OnChangeButton( IDB_ON, 1, RGB(0,0,0));

else
SwitchToolBar.OnChangeButton( IDB_OFF, 1, RGB(0,0,0));
}

This code compiles fine but the tool bar is blank...

Would appreciate any comments or help.

Thanks...

Ozzy

CToolBarCtrl SwitchToolBar;
CImageList* m_ptrImageList;
CImageList SwitchImageList;


int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{

TBBUTTON tb;

if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;

// create CToolBarCtrl toolbar
SwitchToolBar.Create(WS_CHILD|WS_VISIBLE|WS_BORDER|TBSTYLE_FLAT,
CRect(0,0,0,0), this, IDR_TOOLBAR1);

// create ImageList from IDB_SWITCH_IMAGES
SwitchImageList.Create( IDB_SWITCH_IMAGES, 20, 1, RGB(192,0,192));

// get image list pointer
m_ptrImageList = SwitchToolBar.GetImageList();

// set image list for SwitchToolBar
SwitchToolBar.SetImageList( m_ptrImageList );

// assign elements in TBBUTTON structure
tb.iBitmap = 0;
tb.iString = NULL;
tb.fsState = TBSTATE_ENABLED;
tb.fsStyle = TBSTYLE_BUTTON;
tb.idCommand = 0;

// add buttons to list
SwitchToolBar.AddButtons(1, &tb );

return 0;
}
GeneralA big problem while using jpeglib Pin
swandream8-Aug-03 5:15
swandream8-Aug-03 5:15 
GeneralRe: A big problem while using jpeglib Pin
JWood8-Aug-03 6:19
JWood8-Aug-03 6:19 
GeneralRe: A big problem while using jpeglib Pin
swandream8-Aug-03 15:54
swandream8-Aug-03 15:54 
GeneralOwner Drawn Menu Pin
ClickHeRe8-Aug-03 4:52
ClickHeRe8-Aug-03 4:52 
QuestionCTreeCtrl DeleteAllItems() strange behaviour..!? Pin
Halloko8-Aug-03 4:30
Halloko8-Aug-03 4:30 
QuestionMay we make a friends? Pin
HansonDavid8-Aug-03 4:03
HansonDavid8-Aug-03 4:03 
AnswerRe: May we make a friends? Pin
FlyingDancer8-Aug-03 4:43
FlyingDancer8-Aug-03 4:43 
GeneralRe: May we make a friends? Pin
HansonDavid8-Aug-03 4:48
HansonDavid8-Aug-03 4:48 
AnswerRe: May we make a friends? Pin
Maximilien8-Aug-03 5:38
Maximilien8-Aug-03 5:38 
GeneralRe: May we make a friends? Pin
HansonDavid8-Aug-03 17:01
HansonDavid8-Aug-03 17:01 
GeneralEnable a combobox Pin
keegan8-Aug-03 4:02
keegan8-Aug-03 4:02 
GeneralRe: Enable a combobox Pin
User 66588-Aug-03 4:26
User 66588-Aug-03 4:26 
GeneralRe: Enable a combobox Pin
keegan8-Aug-03 4:40
keegan8-Aug-03 4:40 
GeneralRe: Enable a combobox Pin
User 66588-Aug-03 4:51
User 66588-Aug-03 4:51 
GeneralRe: Enable a combobox Pin
jhwurmbach8-Aug-03 4:44
jhwurmbach8-Aug-03 4:44 
GeneralRe: Enable a combobox Pin
keegan8-Aug-03 5:04
keegan8-Aug-03 5:04 
GeneralRe: Enable a combobox Pin
Anthony_Yio11-Aug-03 1:35
Anthony_Yio11-Aug-03 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.