zoukankan      html  css  js  c++  java
  • EditBox control Update Problem (A CString type EditBox control in a loop cannot be updated immidiately)

    Method One

    in the "Add variables " panel, select control instead of value for the category. Then select CListCtrl for variable type.


    Let's assume that the variable for the CListCtrl is m_Progress. In the  loop body, adding

       ((CEdit *)GetDlgItem(IDC_List18)->SetWindowText("Hello"))
       UpdateData(false);
       m_Progress.UpdateWindow();

    (suggested by a thread from codecomments.com
    Create a CEdit member variable such as m_edit. Then you do this to make
    it paint immediately:

    UpdateData(false);
    m_edit.UpdateWindow();


    Methods Two


    for (;;)
    {
    //
    // ... Your stuff to test
    //

    { // Commenting this block will block all messages to app
    // until the loop terminates

    MSG msg;

    while(GetMessage(&msg, 0, 0, NULL))//also try with PeekMessage
    {
    if(!PreTranslateMessage(&msg))
    {
    ::TranslateMessage(&msg);
    ::DispatchMessage(&msg);
    }
    }
    }
    }



  • 相关阅读:
    每日总结50
    每日总结49
    每日总结48
    每日总结47
    每日总结46
    每日总结45
    每日总结44
    每日总结42
    每日总结41
    每日总结39
  • 原文地址:https://www.cnblogs.com/cy163/p/547426.html
Copyright © 2011-2022 走看看