Resize control in toolbars

Amit amitgupta.it at gmail.com
Mon Aug 27 23:36:13 PDT 2007


On Aug 27, 4:08 pm, emilien.... at inrialpes.fr (Emilien Kia) wrote:
> Hello all.
>
> I want to use a toolbar with a control (a combobox) surrounded by
> standard toolbar items. I want this control is re-sized to use all
> available space like a web browser URL bar.
> But I dont find any way to specify this behavior.
>
> Many thanks
>
> Emilien
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscr... at lists.wxwidgets.org
> For additional commands, e-mail: wx-users-h... at lists.wxwidgets.org

Hello Emilien,

A possible solution, which I am using is to capture EVT_SIZE event on
your frame and resize the required control to desired width.

Code Snippet

void CFrame::OnSize(wxSizeEvent& event)
{
        // calculate nDesiredWidth of the control ;
        m_ptrControl->SetSize(nDesiredWidth, -1);
	m_ptrToolBar->Realize();

	event.Skip();
}

I hope this helps.

Regards
- Amit Gupta
www.metadesignsolutions.com







More information about the wx-users mailing list