•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 391,596 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,719 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser:
Views: 1213 | Replies: 2
![]() |
•
•
Join Date: Jun 2005
Location: Tokyo, Japan
Posts: 1,480
Reputation:
Rep Power: 8
Solved Threads: 98
I believe you are asking for a way of updating a Caption of a Static Text Label Control ( IDC_STATIC ) which displays the Clock output without using the UpdateData method. You can do this by the use of Control Variables. It is possible to declare a control variable for any control that has a resource ID not equal to IDC_STATIC.
Therefore in the assumed case of a Static label follow the steps below.
1. Rename the Resouce ID of the Label to something other than IDC_STATIC ( say IDC_TIMEDISPLAY )
2. Right click the IDC_TIMEDISPLAY Control and select Add Variable.
3. Add a variable of anyname you prefer ( say m_TimeDisplay ) and of Category equal to Control.
4. At the event you want to update the Labels text, Just call
m_TimeDisplay.SetWindowText( m_DisplayString );
where m_DisplayString is the CString variable you want to be displayed in the caption.
Therefore in the assumed case of a Static label follow the steps below.
1. Rename the Resouce ID of the Label to something other than IDC_STATIC ( say IDC_TIMEDISPLAY )
2. Right click the IDC_TIMEDISPLAY Control and select Add Variable.
3. Add a variable of anyname you prefer ( say m_TimeDisplay ) and of Category equal to Control.
4. At the event you want to update the Labels text, Just call
m_TimeDisplay.SetWindowText( m_DisplayString );
where m_DisplayString is the CString variable you want to be displayed in the caption.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb C++ Marketplace
Similar Threads
- Error connecting to database (ASP.NET)
- updating 2 HTML tables on one PHP page (PHP)
- Populating & Retrieving Data in a listbox : ASP.NET (w/ VB.NET) (ASP.NET)
- 35 processes, need to trim the fat (Viruses, Spyware and other Nasties)
- ASP.NET controls in Office 2003 style? (ASP.NET)
- Drag and Drop controls? (Visual Basic 4 / 5 / 6)
Other Threads in the C++ Forum
- Previous Thread: {i really need help on this} how to write a special purpose shell in C...
- Next Thread: Couple of little things



Linear Mode