Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Dialog box with changeable STATIC text and TITLE

Dialog box with changeable STATIC text and TITLE

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RomTibi
    wrote on last edited by
    #1

    I need an example with a dialog box containing a STATIC text that can be changed before showing the dialog box. Maybe the title to be also changed. Please...

    36. When you surround an army, leave an outlet free. ... Do not press a desperate foe too hard. SUN-TZU - Art of War

    O P 2 Replies Last reply
    0
    • R RomTibi

      I need an example with a dialog box containing a STATIC text that can be changed before showing the dialog box. Maybe the title to be also changed. Please...

      36. When you surround an army, leave an outlet free. ... Do not press a desperate foe too hard. SUN-TZU - Art of War

      O Offline
      O Offline
      Oliver123
      wrote on last edited by
      #2

      This changes the dialog title caption from within the dialog class: CString windowCaption; windowCaption.Format("%s", SomeString); this->SetWindowText(windowCaption);

      R 1 Reply Last reply
      0
      • R RomTibi

        I need an example with a dialog box containing a STATIC text that can be changed before showing the dialog box. Maybe the title to be also changed. Please...

        36. When you surround an army, leave an outlet free. ... Do not press a desperate foe too hard. SUN-TZU - Art of War

        P Offline
        P Offline
        Paresh Chitte
        wrote on last edited by
        #3

        Override the CDialog::OnInitDialog. BOOL CMyDlg::OnInitDialog() { GetDlgItem(IDC_STATIC)->SetWindowText(_T("New Text")); return TRUE; } See here[^] for more information in SetWindowText. Regards, Paresh.

        R 1 Reply Last reply
        0
        • O Oliver123

          This changes the dialog title caption from within the dialog class: CString windowCaption; windowCaption.Format("%s", SomeString); this->SetWindowText(windowCaption);

          R Offline
          R Offline
          RomTibi
          wrote on last edited by
          #4

          Thanks! :)

          36. When you surround an army, leave an outlet free. ... Do not press a desperate foe too hard. SUN-TZU - Art of War

          1 Reply Last reply
          0
          • P Paresh Chitte

            Override the CDialog::OnInitDialog. BOOL CMyDlg::OnInitDialog() { GetDlgItem(IDC_STATIC)->SetWindowText(_T("New Text")); return TRUE; } See here[^] for more information in SetWindowText. Regards, Paresh.

            R Offline
            R Offline
            RomTibi
            wrote on last edited by
            #5

            Thanks! a lot:)

            36. When you surround an army, leave an outlet free. ... Do not press a desperate foe too hard. SUN-TZU - Art of War

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups