Loading ...
Sorry, an error occurred while loading the content.

Change Text on static labels

Expand Messages
  • yusuftran
    Hi Guys, I ve been reading up on much of the articles at codeproject.com and have been trying to experiment. I ve used the WTL wizard to create an application
    Message 1 of 3 , Dec 11, 2011
    • 0 Attachment
      Hi Guys,

      I've been reading up on much of the articles at codeproject.com and have been trying to experiment. I've used the WTL wizard to create an application template, nothing fancy just a modal dialog app with the default ok, cancel and about button.

      To experiment I've added a static label and a new button. I've added the button under the mappings area and have mapped it to a new function (a copy and paste of the onOK function).

      To test I want to the static label's text to change when I click the new button, I am getting a little confused with the DDX code and was hoping someone can describe what I would need to do to be able to set / change the static label's text.

      Any pointers would be much appreciated :)
    • Igor Tandetnik
      ... In the simplest case, just give your static label a distinct ID (as opposed to the default of IDC_STATIC) and call SetDlgItemText(label_id, text ) in the
      Message 2 of 3 , Dec 13, 2011
      • 0 Attachment
        On 12/11/2011 5:33 PM, yusuftran wrote:
        > To test I want to the static label's text to change when I click the
        > new button, I am getting a little confused with the DDX code and was
        > hoping someone can describe what I would need to do to be able to set
        > / change the static label's text.

        In the simplest case, just give your static label a distinct ID (as
        opposed to the default of IDC_STATIC) and call SetDlgItemText(label_id,
        "text") in the button click handler.
        --
        Igor Tandetnik
      • yusuftran
        It Works, I ve gotten through my Hello World program :) Thank you sooo much :)
        Message 3 of 3 , Dec 13, 2011
        • 0 Attachment
          It Works, I've gotten through my "Hello World" program :)
          Thank you sooo much :)

          --- In wtl@yahoogroups.com, Igor Tandetnik <itandetnik@...> wrote:
          >
          > On 12/11/2011 5:33 PM, yusuftran wrote:
          > > To test I want to the static label's text to change when I click the
          > > new button, I am getting a little confused with the DDX code and was
          > > hoping someone can describe what I would need to do to be able to set
          > > / change the static label's text.
          >
          > In the simplest case, just give your static label a distinct ID (as
          > opposed to the default of IDC_STATIC) and call SetDlgItemText(label_id,
          > "text") in the button click handler.
          > --
          > Igor Tandetnik
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.