dynamically add buttons to toolbar |
Post Reply |
Author | |
spelhatre
Newbie Joined: 09 January 2006 Status: Offline Points: 15 |
Post Options
Thanks(0)
Posted: 25 January 2006 at 10:30am |
I use control CXTPToolBar and dynamically add buttons:
toolbar->GetControls()->Add(xtpControlButton, ....) But buttons and not drawn correctly. I see only a part of the first button. If my toolbar is floating, it's OK. But if it is docked (at the top in my case) I have to undock it to see my buttons. I tried several things but unsuccessfully: CSize sz = toolbar->CalcDynamicLayout(0, LM_HORZ); toolbar->SetWindowPos(&CWnd::wndTop, 0, 0, sz.cx, sz.cy, 0); OR toolbar->GetParent()->RepositionBars(AFX_IDW_CON TROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0); OR toolbar->RedrawWindow(); toolbar->UpdateWindow(); toolbar->GetParent()->UpdateWindow(); |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Is it dialog application? |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
spelhatre
Newbie Joined: 09 January 2006 Status: Offline Points: 15 |
Post Options
Thanks(0)
|
|
|
spelhatre
Newbie Joined: 09 January 2006 Status: Offline Points: 15 |
Post Options
Thanks(0)
|
MDI application but the window with the dynamic toolbar is a dialogbox
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Just repeat code you have in OnSize, or call dialog OnSize as method something: CSize sz = toolbar->CalcDynamicLayout(0, LM_HORZ|LM_COMMIT);
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |