Click here to Skip to main content
15,886,199 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Reading CSV file using C Pin
ThatsAlok6-Feb-07 20:10
ThatsAlok6-Feb-07 20:10 
QuestionSizing controls Pin
baerten5-Feb-07 1:55
baerten5-Feb-07 1:55 
AnswerRe: Sizing controls Pin
Waldermort5-Feb-07 2:10
Waldermort5-Feb-07 2:10 
GeneralRe: Sizing controls Pin
baerten5-Feb-07 3:10
baerten5-Feb-07 3:10 
GeneralRe: Sizing controls Pin
Waldermort5-Feb-07 3:22
Waldermort5-Feb-07 3:22 
GeneralRe: Sizing controls Pin
baerten5-Feb-07 3:41
baerten5-Feb-07 3:41 
QuestionCToolBar basic questions Pin
PatrykDabrowski5-Feb-07 1:02
PatrykDabrowski5-Feb-07 1:02 
AnswerRe: CToolBar basic questions Pin
Mark Salsbery5-Feb-07 6:54
Mark Salsbery5-Feb-07 6:54 
First - Toolbar Controls Overview[^]

PatrykDabrowski wrote:
How to change button's position? - I would like to move them closer, without a single pixel of free space between. (or just 2 pixels right and bottom for 'press' effect)


A combination of TB_SETMETRICS message to set button spacing and using separators between
buttons will help for custiomizing spacing.

PatrykDabrowski wrote:
How to disable this square box around button's bitmap when I hover/press the button?


Use image lists to have control over button images.

PatrykDabrowski wrote:
And finally what message/base class member function should I override to make my bitmaps transparent?


This has nothing to do with WM_ERASEBKGND (actually toolbars have the TBSTYLE_TRANSPARENT style
so you don't have to do that). For the button images you need to use a masked image list with
the mask created using a certain color in the bitmap that represents transparent.

For example, this code takes a 24bit source bitmap resource and creates a masked image list
from it, using bright green as the transparent color...
// Load source bitmap resource (24bit, 64x32 (Two 32x32 images))
CBitmap bitmap;
bitmap.LoadBitmap(IDB_TOOLBARBITMAP);
 
// Create image list - Each image 32x32, initially with 2 images, growby 1
m_ToolBarImageList.Create(32, 32, ILC_COLOR24|ILC_MASK, 2, 1);
 
// Add the bitap to the image list - mask will be created automagically
m_ToolBarImageList.Add(&bitmap, RGB(0x00,0xFF,0x00));

When the toolbar is created set its image list to the image list created above:
static TBBUTTON ToolBarButtonDescs[] =
{
   {0, ID_BUTTON1, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0,0}, 0, 0},
   {1, ID_BUTTON2, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0,0}, 0, 0}
};
 
m_ToolBar.CreateEx(this, TBSTYLE_FLAT);
m_ToolBar.SetSizes(CSize(39,38), CSize(32,32));
m_ToolBar.GetToolBarCtrl().SetImageList(&m_ToolBarImageList);
m_ToolBar.GetToolBarCtrl().AddButtons(2, ToolBarButtonDescs);

QuestionRe: CToolBar basic questions Pin
PatrykDabrowski5-Feb-07 12:58
PatrykDabrowski5-Feb-07 12:58 
AnswerRe: CToolBar basic questions Pin
Mark Salsbery5-Feb-07 13:37
Mark Salsbery5-Feb-07 13:37 
QuestionXPCOM Creation Pin
johnalek5-Feb-07 0:53
johnalek5-Feb-07 0:53 
AnswerRe: XPCOM Creation Pin
_AnsHUMAN_ 5-Feb-07 1:16
_AnsHUMAN_ 5-Feb-07 1:16 
AnswerRe: XPCOM Creation Pin
Hamid_RT5-Feb-07 7:49
Hamid_RT5-Feb-07 7:49 
AnswerRe: XPCOM Creation Pin
ThatsAlok6-Feb-07 20:11
ThatsAlok6-Feb-07 20:11 
Questionrelated to network module Pin
sudhir.marni5-Feb-07 0:23
sudhir.marni5-Feb-07 0:23 
GeneralRe: related to network module Pin
johnalek5-Feb-07 1:12
johnalek5-Feb-07 1:12 
AnswerRe: related to network module Pin
David Crow5-Feb-07 3:01
David Crow5-Feb-07 3:01 
AnswerRe: related to network module Pin
Hamid_RT5-Feb-07 7:46
Hamid_RT5-Feb-07 7:46 
QuestionON Network module Pin
Member 35534025-Feb-07 0:17
Member 35534025-Feb-07 0:17 
AnswerRe: ON Network module Pin
Waldermort5-Feb-07 2:06
Waldermort5-Feb-07 2:06 
AnswerRe: ON Network module Pin
David Crow5-Feb-07 3:03
David Crow5-Feb-07 3:03 
AnswerRe: ON Network module Pin
Eytukan5-Feb-07 3:15
Eytukan5-Feb-07 3:15 
AnswerRe: ON Network module Pin
Hamid_RT5-Feb-07 7:42
Hamid_RT5-Feb-07 7:42 
QuestionMFC STATUS BAR PROBLEM Pin
T.RATHA KRISHNAN4-Feb-07 23:44
T.RATHA KRISHNAN4-Feb-07 23:44 
AnswerRe: MFC STATUS BAR PROBLEM Pin
kasturi_haribabu5-Feb-07 0:04
kasturi_haribabu5-Feb-07 0:04 

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.