![]()  | 
 
Stretch a control to the end of a toolbar | 
 
    Post Reply  
   | 
  
| Author | |
   
   spike  
   
   Groupie  
   Joined: 13 May 2003 Location: United States Status: Offline Points: 48  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Topic: Stretch a control to the end of a toolbarPosted: 23 July 2004 at 9:46am  | 
 
| 
   
    Does anyone know a way to stretch a control (edit) to the end of a toolbar its in? CXTPCommandBars* pCommandBars = GetCommandBars(); CXTPToolBar* pCommandBar = (CXTPToolBar*)pCommandBars->Add(_T("Output Queue Toolbar"), xtpBarTop);  if( pCommandBar ) CXTPControlEdit *pControl = (CXTPControlEdit *)pCommandBar->GetControls()->Add( xtpControlEdit, ID_OUTPUTFILTER_EDIT ); pControl->SetCaption( "Filter:" ); pCommandBar->SetFlags(xtpFlagStretched);   pCommandBar->EnableDocking( xtpFlagStretched ); I just have the one edit control in the toolbar and would like it to take up the whole width of the toolbar and size when the toolbar is sized. 
 Thanks Craig 
  | 
 |
![]()  | 
 |
   
   SuperMario  
   
   Senior Member  
    
   Joined: 14 February 2004 Status: Offline Points: 18057  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 06 August 2004 at 9:13am | 
 
| 
   
    
   No one has responded to this post, so I'll see if I can help. 
   
  I haven't tried this, but I would use the GetWidth method for the CommandBar to determine the size. Assuming that the edit control is the only control on the toolbar (from your post, it sounds like it is), then I would use the SetWidth method on the Edit control.  | 
 |
![]()  | 
 |
   
   spike  
   
   Groupie  
   Joined: 13 May 2003 Location: United States Status: Offline Points: 48  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 06 December 2004 at 8:32am | 
 
| 
   
    CAn someone from codejock help here? This hasnt been answered and I still dont have a good solution for it. 
 Thanks 
  | 
 |
![]()  | 
 |
   
   Oleg  
   
   Senior Member  
   Joined: 21 May 2003 Location: United States Status: Offline Points: 11234  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 06 December 2004 at 3:11pm | 
 
| 
   
    in next version we will add xtpFlagControlStretched flag. You can patch your sources if you don't want wait next version: 1. add XTPControlFlags::xtpFlagControlStretched = 32 (XTPCommandBarDefines.h) 2. replace in XTPControls.cpp: void CXTPControls::_MoveRightAlligned(XTPBUTTONINFO* pData, CSize sizeResult, CRect rcBorder, DWORD dwMode) [attached] 
 3. Now you can use it: 
 CXTPControlComboBox* pComboMasked = (CXTPControlComboBox*)CControlComboBoxEx::CreateObject(); lpCreateControl->pControl = pComboMasked; Edited by oleg  | 
 |
| 
   
     
     Oleg, Support Team 
   
  CODEJOCK SOFTWARE SOLUTIONS  | 
 |
![]()  | 
 |
   
   Oleg  
   
   Senior Member  
   Joined: 21 May 2003 Location: United States Status: Offline Points: 11234  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 06 December 2004 at 3:14pm | 
 
| 
   
     
     Oleg, Support Team 
   
  CODEJOCK SOFTWARE SOLUTIONS  | 
 |
![]()  | 
 |
   
   spike  
   
   Groupie  
   Joined: 13 May 2003 Location: United States Status: Offline Points: 48  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 06 December 2004 at 6:04pm | 
 
| 
   
    
   Thanks Oleg, I will give it a shot tomorrow.
    
   
   | 
 |
![]()  | 
 |
    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  |