User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Mar 2005
Posts: 64
Reputation: atrusmre is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
atrusmre's Avatar
atrusmre atrusmre is offline Offline
Junior Poster in Training

Updating Controls

  #1  
Nov 1st, 2005
In Visual C++ is there a way to update a singal control without updating them all? If so how?
(for example, I want to have a clock in my program that doesn't interfer with my trying to type other things).
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2005
Location: Tokyo, Japan
Posts: 1,480
Reputation: WolfPack has a spectacular aura about WolfPack has a spectacular aura about WolfPack has a spectacular aura about 
Rep Power: 8
Solved Threads: 98
Moderator
WolfPack's Avatar
WolfPack WolfPack is offline Offline
Mentally Challenged Mod.

Re: Updating Controls

  #2  
Nov 1st, 2005
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.
Reply With Quote  
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 10,546
Reputation: Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of 
Rep Power: 36
Solved Threads: 860
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is online now Online
Most Valuable Poster

Re: Updating Controls

  #3  
Nov 2nd, 2005
If you want the clock in the display to tick off the time while you are typing in another control (such as an edit control), then use SetTime() to set an event to happen once a second. Then in that timer event update the clock display with current time. See MSDN for SetTimer() function.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb C++ Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the C++ Forum

All times are GMT -4. The time now is 11:37 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC