Toolbar unten rechts ausrichten
-
Kann mir jemand sagen, warum ich mein zweites Toolbar nicht
unten rechts im Dialog angeordnet bekomme
//oben links cToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); cToolBar.LoadToolBar(IDR_TOOLBAR1); cToolBar.ShowWindow(SW_SHOW); cToolBar.SetBarStyle(CBRS_ALIGN_TOP | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST,0); //toolbar2 unten rechts cToolBar2.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_BOTTOM | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); cToolBar2.LoadToolBar(IDR_TOOLBAR3); cToolBar2.ShowWindow(SW_SHOW); cToolBar2.SetBarStyle(CBRS_ALIGN_RIGHT |CBRS_TOOLTIPS | CBRS_FLYBY ); RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST,0);
-
Weil ein CDialog kein CFrameWnd ist. RepositionBars ist für Dialog nicht implementiert, wie auch CView's für Dialoge nicht funktionieren.
Du musst den Toolbar selbst positionieren.
Grund: RepsotionBars versendet eine bestimmmte Nachricht an alle Unterfenster und Toolbars. Diese wird von Cdialog nicht verstanden, am Ende wird das Fenster mit einer bestimmten ID (left over) für den Rest bestimmt.
-
Uhh, thx for the info.
