SetWindowText does not work - Windows CE

This is a discussion on SetWindowText does not work - Windows CE ; Background: Using Visual Studio 2005, target PocketPC 2003 SE Emulator I have a button on a dialog that I would like to change the text at run time. A add a CButton variable using DoDataExchange() -- DDX_Control(pDX, IDC_DONE, m_btnDone); In ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: SetWindowText does not work

  1. SetWindowText does not work

    Background: Using Visual Studio 2005, target PocketPC 2003 SE Emulator

    I have a button on a dialog that I would like to change the text at run
    time.

    A add a CButton variable using DoDataExchange()
    -- DDX_Control(pDX, IDC_DONE, m_btnDone);

    In the InitDialog(), I try to set new text using SetWindowText()
    -- m_btnDone.SetWindowText(L"Main");

    Nothing happens. The button text does not change. Any suggestions?


    --
    ---------------------------------------------------------------------
    DataGet® & PocketLog® www.dataget.com
    Data Collectors www.baxcode.com
    --------------------------------------------------------------------





  2. Re: SetWindowText does not work

    Questions about programming are far more likely to get useful answers
    if asked in a newsgroup for programmers. In this case, you are
    targeting Pocket PC and not using a .NET language, so
    microsoft.public.pocketpc.developer is a reasonable choice.

    More below (in line).



    On Tue, 3 Oct 2006 16:15:05 -0700, "Baxter"
    wrote:

    >Background: Using Visual Studio 2005, target PocketPC 2003 SE Emulator
    >
    >I have a button on a dialog that I would like to change the text at run
    >time.
    >
    >A add a CButton variable using DoDataExchange()
    > -- DDX_Control(pDX, IDC_DONE, m_btnDone);


    I don't use MFC, so I'm not sure about details.


    >
    >In the InitDialog(), I try to set new text using SetWindowText()
    > -- m_btnDone.SetWindowText(L"Main");
    >
    >Nothing happens. The button text does not change. Any suggestions?


    Try calling UpdateWindow. If that doesn't work, try calling
    InvalidateRect and then UpdateWindow.


    -----------------------------------------
    To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

    Robert E. Zaret, eMVP
    PenFact, Inc.
    20 Park Plaza, Suite 478
    Boston, MA 02116
    www.penfact.com

  3. Re: SetWindowText does not work


    wrote in message
    news:vfr7i25j67sorcocekmirq2a9sk7ikq6rc@4ax.com...
    >
    > >
    > >In the InitDialog(), I try to set new text using SetWindowText()
    > > -- m_btnDone.SetWindowText(L"Main");
    > >
    > >Nothing happens. The button text does not change. Any suggestions?

    >
    > Try calling UpdateWindow. If that doesn't work, try calling
    > InvalidateRect and then UpdateWindow.
    >

    I've not heard of doing that from within the OnInitDialog() routine - the
    dialog has not yet been painted.

    note that m_btnDone.SetWindowText(L"Main"); does work outside the
    OnInitDialog().




+ Reply to Thread