Skip to content

weirdo12

  • Home
  • About

Recent Posts

  • Wednesday. Elderberry Wine.
  • Bob Mould. Here We Go Crazy.
  • Steven Wilson. Objects Outlive Us.
  • Ben Folds. From Above.
  • Isaac Hayes. Close To You.

Recent Comments

Archives

  • January 2026
  • December 2025
  • November 2025
  • October 2025
  • July 2025
  • June 2025
  • May 2025
  • January 2025
  • December 2024
  • April 2024
  • March 2024
  • September 2023
  • August 2023
  • June 2023
  • 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

  • Create account
  • 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.
  • Subscribe Subscribed
    • weirdo12
    • Already have a WordPress.com account? Log in now.
    • weirdo12
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar