GIDForums  

Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 21-Oct-2004, 06:33
arran.s arran.s is offline
New Member
 
Join Date: Oct 2004
Posts: 1
arran.s is on a distinguished road

Detecting a mouse click outside of control


Hi,

I have a CDateTimeCtrl which I am growing in size when the focus is set and shrinking back to its normal size when focus is killed.

at the moment the only way I can get the control to lose focus is to set the focus onto another control.

Ideally when the user clicks anywhere outside of the control the focus should be lost and the CDateTimeCtrl shrink back to its normal size.

the ComboBox control obvioulsy does something similar but can I do it with my CDateTimeCtrl? I am using eVC++ 3 for Windows CE.

Many thanks

Arran
  #2  
Old 27-Oct-2004, 06:01
LuciWiz's Avatar
LuciWiz LuciWiz is offline
Moderator
 
Join Date: Jul 2004
Location: Cluj-Napoca (Romania)
Posts: 918
LuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the rough
Quote:
Originally Posted by arran.s
at the moment the only way I can get the control to lose focus is to set the focus onto another control.

I think you should go with this....


Just give the focus to another control (I used a button) when the user clicks the dialog:


CPP / C++ / C Code:
void CTestingDlg::OnLButtonDown(UINT nFlags, CPoint point) 
{

	m_button.SetFocus();
	m_button.SetButtonStyle(1);

	CDialog::OnLButtonDown(nFlags, point);
}


Hope this is good enough for you - I don't have another idea right now

Quote:
Originally Posted by arran.s
I am using eVC++ 3 for Windows CE.


The horror!

Kind regards,
Luci
__________________
Please read these Guidelines before posting on the forum

"A person who never made a mistake never tried anything new."
Einstein
 
 

Recent GIDBlogDeveloping GUIs with wxPython (Part 4) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add progress text to an MFC progress control? m_dale MS Visual C++ / MFC Forum 3 07-Jan-2005 02:25
[Program/Tutorial] RandMouse aaroncohn C Programming Language 5 17-Dec-2004 19:22
changing caption of static text control Pandiani MS Visual C++ / MFC Forum 1 20-Sep-2004 01:38
list of the most common keyboard and mouse shortcuts for IE, Opera and Firebird jrobbio Computer Software Forum - Windows 2 04-Sep-2003 09:10
Sydog's DVD to Divx Conversion Guide asanthadenz Computer Software Forum - Windows 1 14-Mar-2003 14:08

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 20:27.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.