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

Resizing custom controls

 Post Reply Post Reply
Author
Message
Simon HB9DRV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 July 2005
Location: Switzerland
Status: Offline
Points: 458
Post Options Post Options   Thanks (0) Thanks(0)   Quote Simon HB9DRV Quote  Post ReplyReply Direct Link To This Post Topic: Resizing custom controls
    Posted: 27 July 2008 at 4:47am
Hi,
 
Using ON_XTP_CREATECONTROL I create my own custom control.
 
I want to resize this later on - how do I resize my control and get the new size displayed in the toolbar?
 
m_rotatorAzimValue is derrived from CWnd.
 
  //
  // Create the static control.
  //
  CRect rect(0,0,100,16);
  if (!m_rotatorAzimValue.Create(NULL,
            NULL,
            WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
            rect,
            this,
            ID_AZIM_VALUE,
            NULL))
  {
   return FALSE;
  }
  //
  // Create a CXTPControlCustom*.
  //
  CXTPControlCustom* pControlAzimValue = CXTPControlCustom::CreateControlCustom(&m_rotatorAzimValue);
  //
  // Set the margins of the control.
  //
  pControlAzimValue->SetBorders(3, 0, 3, 0);
  pControlAzimValue->SetVerticalPositionOption(xtpVerticalHide);
  pControlAzimValue->SetFlags(xtpFlagManualUpdate);
  lpCreateControl->pControl = pControlAzimValue;
Simon HB9DRV
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 28 July 2008 at 2:51am
Hi,
 
You need find custom control that was created (pCommandBars->FindControl) and change its size
 
pControl->SetWidth(...);
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Simon HB9DRV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 July 2005
Location: Switzerland
Status: Offline
Points: 458
Post Options Post Options   Thanks (0) Thanks(0)   Quote Simon HB9DRV Quote  Post ReplyReply Direct Link To This Post Posted: 28 July 2008 at 3:09am
Originally posted by oleg oleg wrote:

Hi,
 
You need find custom control that was created (pCommandBars->FindControl) and change its size
 
pControl->SetWidth(...);
 
OK - I thought I tried that - will have another go, sorry to waste your time.
Simon HB9DRV
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.047 seconds.