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. Other Discussions
  3. Article Writing
  4. [Q] SetWindowText on Edit Boxes...

[Q] SetWindowText on Edit Boxes...

Scheduled Pinned Locked Moved Article Writing
comtoolstutorialquestionannouncement
2 Posts 2 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
    rbid
    wrote on last edited by
    #1

    Hello, Setting the edit box text via SetWindowText does not work inmediatelly if you set it from one of the handlers of your dialog. Instead, the update will happen only after the handler ends its run.

    void CDemoDlg::OnNewBnClicked()
    {

    GetDlgItem(IDC\_EDIT)->SetWindowText("New");
    
    // Some code that takes few msec to end
    

    }

    If I replace the Edit Control with a static control, the text is updated inmediatelly. I guess that the answer is the use of SendMessage and PostMessage. Is there a way to update an edit control inmediatelly and not wait till the handler ends? If you want to display for example the results when the user moves a slidebar, the edit control will not be updated until the cursor stops. Any hint? (I need an edit control there :( -- **Ricky Marek** (_AKA: rbid_) -- "Things are only impossible until they are not" --- Jean-Luc Picard My articles

    B 1 Reply Last reply
    0
    • R rbid

      Hello, Setting the edit box text via SetWindowText does not work inmediatelly if you set it from one of the handlers of your dialog. Instead, the update will happen only after the handler ends its run.

      void CDemoDlg::OnNewBnClicked()
      {

      GetDlgItem(IDC\_EDIT)->SetWindowText("New");
      
      // Some code that takes few msec to end
      

      }

      If I replace the Edit Control with a static control, the text is updated inmediatelly. I guess that the answer is the use of SendMessage and PostMessage. Is there a way to update an edit control inmediatelly and not wait till the handler ends? If you want to display for example the results when the user moves a slidebar, the edit control will not be updated until the cursor stops. Any hint? (I need an edit control there :( -- **Ricky Marek** (_AKA: rbid_) -- "Things are only impossible until they are not" --- Jean-Luc Picard My articles

      B Offline
      B Offline
      BlackDice
      wrote on last edited by
      #2

      have you tried calling UpdateWindow()? My articles www.stillwaterexpress.com BlackDice

      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