Print Page | Close Window

Resizing custom controls

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=11598
Printed Date: 06 November 2025 at 7:40pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Resizing custom controls
Posted By: Simon HB9DRV
Subject: Resizing custom controls
Date 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



Replies:
Posted By: Oleg
Date 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


Posted By: Simon HB9DRV
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net