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