Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Toolbar Resizing Problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Toolbar Resizing Problem

 Post Reply Post Reply
Author
Message
aimslife View Drop Down
Newbie
Newbie
Avatar

Joined: 19 January 2007
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote aimslife Quote  Post ReplyReply Direct Link To This Post Topic: Toolbar Resizing Problem
    Posted: 15 March 2007 at 1:58am

Hi,

I am using “Xtreme Toolkit Pro v10.4” with vs2k5. I made toolbar which contain two items, Static Text Control and Custom Control which is Combo Box Extended. I need to make this toolbar resizable, it resize when my window resizes. Combo box resizing working fine when I reduce horizontal size of the window, but when I increase horizontal size of the window then it seems that combo box resizing working fine but toolbar items container size is not increasing [shown in image]. Please guide me, how I can increase toolbar size??

I tried following code to perform this task, but I had no success in it.

I wrote following code in OnCreateControl function. m_wndAddressCombo(CXTComboBoxEx) is member of CMainFrame class.

    if (lpCreateControl->nID == ID_GO_FOLDER && pToolBar->GetBarID() == IDR_MAILADDRESS)
    {
      CRect rCombo;
      this->GetDesktopWindow()->GetWindowRect(&rCombo);
      if( !m_wndAddressCombo.Create(WS_CHILD|WS_VISIBLE|CBS_DROPDOWN|WS_CLIPCHILDREN,
            rCombo, this, ID_GO_FOLDER))
      {
        TRACE(_T("Failed to create combo-box\n"));
        return FALSE;      // fail to create
      }
      m_wndAddressCombo.SetOwner(this);
      this->GetWindowRect(&rCombo);
      this->m_wndAddressCombo.MoveWindow(55, 3, rCombo.Width() - 65, 25);

      CXTPControlCustom * pAddressCombo = CXTPControlCustom::CreateControlCustom(&m_wndAddressCombo);
      pAddressCombo->SetFlags(xtpFlagManualUpdate);

      lpCreateControl->pControl = pAddressCombo;
      return TRUE;
    }

I wrote following code wrote in OnSize function.

  if(this->m_wndAddressCombo.GetSafeHwnd())
  {
    CRect rect;
    CRect wrect;
    this->GetWindowRect(wrect);
    this->m_wndAddressCombo.ShowWindow(SW_HIDE);
    this->m_wndAddressCombo.GetWindowRect(rect);

    int iXaxis = wrect.Width() - 70;
    if(iXaxis > 0)
      this->m_wndAddressCombo.MoveWindow(55, 3, iXaxis, rect.Height());
    else
      this->m_wndAddressCombo.MoveWindow(55, 3, iXaxis + 70, rect.Height());
    this->m_wndAddressCombo.ShowWindow(SW_SHOW);
  }

Regards,
-aims


regards,
-aims
.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.