Click here to Skip to main content
16,004,974 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: VC vs VB Pin
BlackDice18-Nov-04 3:10
BlackDice18-Nov-04 3:10 
GeneralRe: VC vs VB Pin
pc_dev18-Nov-04 16:20
pc_dev18-Nov-04 16:20 
QuestionHow can I ............... Pin
pc_dev17-Nov-04 18:53
pc_dev17-Nov-04 18:53 
AnswerRe: How can I ............... Pin
ThatsAlok17-Nov-04 19:27
ThatsAlok17-Nov-04 19:27 
GeneralMultiple row selection in MSFlexGrid Pin
balajeedurai17-Nov-04 18:47
balajeedurai17-Nov-04 18:47 
QuestionHow to make ToolBarCtrl use diffrent size icons? Pin
softwolf17-Nov-04 18:32
softwolf17-Nov-04 18:32 
AnswerHow to make ToolBarCtrl use different size icons? Pin
softwolf17-Nov-04 18:35
softwolf17-Nov-04 18:35 
GeneralRe: How to make ToolBarCtrl use different size icons? Pin
BlackDice18-Nov-04 3:16
BlackDice18-Nov-04 3:16 
this is what I used in my CMainFrame class's OnCreate() handler function. My bitmap has 9 32 x 32 bitmaps in one image.
<code>//create an HBITMAP for the image
	HBITMAP hbm = (HBITMAP)::LoadImage(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_BITMAP1), IMAGE_BITMAP, 0,0, // cx, cy
	LR_CREATEDIBSECTION | LR_LOADMAP3DCOLORS );
	
	//make a CBitmap and attach HBITMAP to it
	CBitmap bm;
	bm.Attach(hbm);


	//create imagelist and specify 256 colors
	int ret = m_ilToolBar.Create(32,32,ILC_COLOR8 | ILC_MASK,1,0);
	ret = m_ilToolBar.Add(&bm,RGB(0,0,0)); //The second parameter sets the black background color to transparent

	m_wndToolBar.GetToolBarCtrl().SetImageList(&m_ilToolBar);

	//make toolbar buttons the appropriate size
	SIZE szButton,szImage;
	szButton.cx = 39; //button width must be 7 pixels greater than image
	szButton.cy = 38; //height must be 6 pixels greater than image
	szImage.cx = 32;
	szImage.cy = 32;
	m_wndToolBar.SetSizes(szButton,szImage);

	//should be called after any resizing is done to buttons or images
	m_wndToolBar.GetToolBarCtrl().AutoSize();</code>


If I write code in my sleep, does that make me brilliant, or just a lazy programmer?

My articles

www.stillwaterexpress.com

BlackDice - the programmer formerly known as bdiamond
GeneralRe: How to make ToolBarCtrl use different size icons? Pin
softwolf19-Nov-04 0:30
softwolf19-Nov-04 0:30 
GeneralBC Conio lovers Pin
Zohaib Sibte Hassan17-Nov-04 18:14
Zohaib Sibte Hassan17-Nov-04 18:14 
GeneralRe: BC Conio lovers Pin
alex.barylski17-Nov-04 18:54
alex.barylski17-Nov-04 18:54 
GeneralRe: BC Conio lovers Pin
ThatsAlok18-Nov-04 0:30
ThatsAlok18-Nov-04 0:30 
GeneralRe: BC Conio lovers Pin
ThatsAlok18-Nov-04 0:30
ThatsAlok18-Nov-04 0:30 
GeneralRe: BC Conio lovers Pin
Demonware66618-Nov-04 7:46
Demonware66618-Nov-04 7:46 
GeneralSelectObject Failed Pin
alex.barylski17-Nov-04 16:43
alex.barylski17-Nov-04 16:43 
GeneralRe: SelectObject Failed Pin
Jack Puppy17-Nov-04 17:14
Jack Puppy17-Nov-04 17:14 
GeneralRe: SelectObject Failed Pin
alex.barylski17-Nov-04 17:54
alex.barylski17-Nov-04 17:54 
GeneralRe: SelectObject Failed Pin
alex.barylski17-Nov-04 17:59
alex.barylski17-Nov-04 17:59 
GeneralRe: SelectObject Failed Pin
alex.barylski17-Nov-04 18:48
alex.barylski17-Nov-04 18:48 
GeneralRe: SelectObject Failed Pin
Jack Puppy18-Nov-04 14:46
Jack Puppy18-Nov-04 14:46 
GeneralActiveX Spreadsheet Control Help Pin
Larry J. Siddens17-Nov-04 13:30
Larry J. Siddens17-Nov-04 13:30 
GeneralCxImage-adding *.h files to ext. dependencies Pin
ashsri17-Nov-04 12:56
ashsri17-Nov-04 12:56 
GeneralRe: CxImage-adding *.h files to ext. dependencies Pin
Michael Dunn17-Nov-04 15:46
sitebuilderMichael Dunn17-Nov-04 15:46 
Generaldnsquery Pin
Member 151831117-Nov-04 12:32
Member 151831117-Nov-04 12:32 
GeneralLNK2005: _DllMain@12 Pin
Anonymous17-Nov-04 11:19
Anonymous17-Nov-04 11:19 

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.