Re: Code Snippet of Display Text on Button Control
- From: "AliR \(VC++ MVP\)" <AliR@xxxxxxxxxxxxx>
- Date: Tue, 06 Mar 2007 16:30:05 GMT
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
.
- References:
- Code Snippet of Display Text on Button Control
- From: lucky
- Code Snippet of Display Text on Button Control
- Prev by Date: Re: Grabbing desktop image under a window
- Next by Date: SetupDiGetDeviceInfoListDetail() buffer problem
- Previous by thread: Re: Code Snippet of Display Text on Button Control
- Next by thread: Re: Code Snippet of Display Text on Button Control
- Index(es):
Relevant Pages
|