CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2011
    Posts
    1

    Windows Controls To Hold Numbers

    Hey everyone. I have a beginner question. I have recently started writing programs with the winapi and its controls. My question is which control is the best to use for storing numerical data. I am writing a small game and need to know what control to use to store player data and display the data in the program. It should not be a control editable by the user but be able to display game data. Thanks.

  2. #2
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,234

    Re: Windows Controls To Hold Numbers

    The most appropriate for your purpose are Static controls.
    Alternatively, you can use Edit controls with ES_READONLY style set.
    To set and get numeric data, you can call SetDlgItemInt and GetDlgItemInt, respectively.
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  3. #3
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: Windows Controls To Hold Numbers

    what control to use to store player data and display the data in the program
    It's important to understand that the mentioned static and edit controls' primary intention is to display numbers, but not store ones. To store data of any kind program variables should be used in the most of the cases.
    Best regards,
    Igor

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured