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

C / C++ / MFC

 
GeneralRe: Adding menu bar to a Dialog Pin
Tomasz Sowinski1-Sep-02 23:53
Tomasz Sowinski1-Sep-02 23:53 
GeneralRe: Adding menu bar to a Dialog Pin
.dan.g.2-Sep-02 15:19
professional.dan.g.2-Sep-02 15:19 
GeneralDetecting Mouse movement Pin
Shibu1-Sep-02 23:31
Shibu1-Sep-02 23:31 
GeneralRe: Detecting Mouse movement Pin
Joaquín M López Muñoz1-Sep-02 23:39
Joaquín M López Muñoz1-Sep-02 23:39 
GeneralRe: Detecting Mouse movement Pin
Hostalet Wandosell1-Sep-02 23:55
Hostalet Wandosell1-Sep-02 23:55 
QuestionInternetOpen() max threads? Pin
mmlxl1-Sep-02 23:29
mmlxl1-Sep-02 23:29 
AnswerRe: InternetOpen() max threads? Pin
Joaquín M López Muñoz1-Sep-02 23:46
Joaquín M López Muñoz1-Sep-02 23:46 
GeneralToolbar resize Pin
Hostalet Wandosell1-Sep-02 23:11
Hostalet Wandosell1-Sep-02 23:11 
I am writting some code to add new buttons in a toolbar at runtime.
My problem:
When i create a new button, the toolbar is not big enough and the last one is no visible anymore. If i move the toolbar to another position in the window (manually, with the mouse), it resize itself automatically and all the buttons become visible again.
How to get the toolbar with the right size automatically , just after adding a new button ?
I try adding Invalidate() and AutoResize(), but it doesn't work.

void CMyAppView::OnAddNewModule() 
{
CToolBarCtrl* pToolBarCtrl;
pToolBarCtrl = &(((CMainFrame*)GetParentFrame())->GetToolbar())->GetToolBarCtrl();

TBBUTTON tbButton;
tbButton.iBitmap = pToolBarCtrl->AddBitmap(1, IDB_MY_RUNTIME_ID);
tbButton.idCommand = MY_NEW_COMMAND;
tbButton.fsState = TBSTATE_ENABLED;
tbButton.fsStyle = TBSTYLE_BUTTON;
tbButton.dwData = NULL;
tbButton.iString = NULL;

if (tbButton.iBitmap==-1)
TRACE("I couldn't load the button image");

if (!pToolBarCtrl->InsertButton(1, &tbButton))
TRACE("I couldn't create the new button");

pToolBarCtrl->AutoSize();
}
Thanks !

PD: I use ON_COMMAND_RANGE handler, to catch the new event with my predefined ID, thanks Saurwein Wink | ;)
GeneralRe: Toolbar resize Pin
.dan.g.2-Sep-02 14:45
professional.dan.g.2-Sep-02 14:45 
GeneralRe: Toolbar resize Pin
Hostalet Wandosell2-Sep-02 20:56
Hostalet Wandosell2-Sep-02 20:56 
GeneralFilemapping Pin
Zizilamoroso1-Sep-02 22:35
Zizilamoroso1-Sep-02 22:35 
GeneralRe: Filemapping Pin
Tomasz Sowinski1-Sep-02 23:50
Tomasz Sowinski1-Sep-02 23:50 
GeneralDisabling a NT account Pin
abhinarulkar1-Sep-02 22:08
abhinarulkar1-Sep-02 22:08 
GeneralRe: Disabling a NT account Pin
Jeremy Pullicino1-Sep-02 23:04
Jeremy Pullicino1-Sep-02 23:04 
GeneralRe: Disabling a NT account Pin
abhinarulkar1-Sep-02 23:49
abhinarulkar1-Sep-02 23:49 
GeneralRe: Disabling a NT account Pin
Jeremy Pullicino2-Sep-02 1:32
Jeremy Pullicino2-Sep-02 1:32 
GeneralRe: Disabling a NT account Pin
Prem Kumar2-Sep-02 2:44
Prem Kumar2-Sep-02 2:44 
QuestionHow to Implement Q261003 Pin
Steve Jensen1-Sep-02 22:08
Steve Jensen1-Sep-02 22:08 
GeneralColoring Toolbar Pin
Anonymous1-Sep-02 21:20
Anonymous1-Sep-02 21:20 
QuestionHow to display the data in mousemove event of mschart Pin
vcLearner1-Sep-02 21:06
vcLearner1-Sep-02 21:06 
General,NULCWnd Creation failed..!! Pin
Renjith Ramachandran1-Sep-02 19:48
Renjith Ramachandran1-Sep-02 19:48 
GeneralRe: ,NULCWnd Creation failed..!! Pin
Hans Ruck1-Sep-02 22:45
Hans Ruck1-Sep-02 22:45 
GeneralSubtle exception/reference problem Pin
Taka Muraoka1-Sep-02 18:47
Taka Muraoka1-Sep-02 18:47 
GeneralRe: Subtle exception/reference problem Pin
Michael Dunn1-Sep-02 19:19
sitebuilderMichael Dunn1-Sep-02 19:19 
GeneralRe: Subtle exception/reference problem Pin
Taka Muraoka1-Sep-02 19:26
Taka Muraoka1-Sep-02 19:26 

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.