Re: Code Snippet of Display Text on Button Control

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



See if this example helps. (The project was done using VS2003)

http://www.learnstar.com/alir/ButtonText.zip

AliR.

"lucky" <Laxmanmaruthy@xxxxxxxxx> wrote in message
news:1173177906.536183.129720@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,

I want to display a text on a button which is dragged from the toolbox
and placed on
the dialog.
I have posted a message regarding this ----> "Displaying text on a
controls"

I got the reply. But it is not still working

Here is the code snippet.....

MyApplicationDlg.h

CButton m_button_control;

MyApplicationDlg.cpp

void CMyApplicationDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_BUTTON_TEST, m_button_control);
}

BOOL CMyApplicationDlg::OnInitDialog()
{
CDialog::OnInitDialog();

(GetDlgItem(IDC_BUTTON1))->SetWindowTextW(L"Hello");

OR (tried both the options)

m_button_control.SetWindowTextW(L"Hello");
UpdateData(FALSE);

return FALSE;
}

I also tried all the options like [1] SetRedraw() [2] Invalidate()
[3] UpdateWindow()
[4] SetFocus
wherever needed to be used in code

But still it is working, what might be the problem i am not getting.

Can anyone please get me out of this problem.................


Thanks
Lucky



.



Relevant Pages

  • Re: Code Snippet of Display Text on Button Control
    ... I want to display a text on a button which is dragged from the toolbox ... UpdateWindow() ...
    (microsoft.public.vc.mfc)
  • Code Snippet of Display Text on Button Control
    ... I want to display a text on a button which is dragged from the toolbox ... SetFocus ...
    (microsoft.public.vc.mfc)
  • Re: help!
    ... If you have an active internet connection and know what language it's in you ... Open the document & if it isn't already displayed click the Toolbox button ... on the Standard toolbar to display the Toolbox. ... button in that palette, then click the bar labeled Translation, specify the ...
    (microsoft.public.mac.office)
  • Re: Subform displays empty box
    ... Allen Browne - Microsoft MVP. ... Tips for Access users - http://allenbrowne.com/tips.html ... It should be possible to SetFocus to another control on the same form in the ... I removed the setfocus and the information does display. ...
    (microsoft.public.access.forms)
  • Re: Opening windows in seperate screens
    ... the toolbox to screen:0.1. ... dat je tussen het openen in gimp kunt zetten?? ... and you don't know what the DISPLAY environment variable is for? ... setenv DISPLAY 127.0.0.1:0.0 ...
    (comp.graphics.apps.gimp)