Skip to content

weirdo12

  • Home
  • About

Recent Posts

  • Pete Townshend. Stop Hurting People.
  • Chet Baker. My Heart Stood Still.
  • Ricki Lee Jones. We Belong Together.
  • The Weather Station. Tried To Tell You
  • Return To Forever. Medieval Overture.

Recent Comments

Archives

  • March 2023
  • December 2022
  • May 2022
  • August 2021
  • February 2021
  • July 2020
  • April 2020
  • March 2020
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • June 2018
  • August 2016

Categories

  • Uncategorized

Meta

  • Register
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.com
Skip to content

weirdo12

Month: June 2018

Range Life

Posted on June 23, 2018 by weirdo12
0

Resizing a TCustomControl to fit TField contents

Posted on June 23, 2018November 14, 2018 by weirdo12
void SizeControlToField(TCustomControl* control, TField* field)
{
HDC DC;
LPTEXTMETRIC lptm = static_cast<LPTEXTMETRIC>(malloc(sizeof(TEXTMETRIC)));
DC = ::GetDC(control->Parent->Handle);
::GetTextMetrics(DC, lptm);
if (field->DataType == TFieldType::ftString) {
control->Width = field->DataSize * lptm->tmAveCharWidth;
}
free(lptm);
}
0
Blog at WordPress.com.
  • Follow Following
    • weirdo12
    • Already have a WordPress.com account? Log in now.
    • weirdo12
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar