Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CStatic notification messages

Status
Not open for further replies.

dima2

Programmer
Jan 20, 2002
85
LB
Hi,
In my MFC application, I have a CStatic control and I'm trying to get a notification when the user clicks the control. I set the SS_NOTIFY style and
I tried to handle the ON_BN_CLICKED and the ON_STN_CLICKED but none of these is getting called.
actually no messages are being sent to the main dialog window (I checked in the PreTranslateMessage) no matter what I do to the static control no notification is sent.

Am I missing something?
what am i doing wrong?
 
CStatic is just used to show the message. It does not have any event for the user to catch.
You have two choices :
1. catch your LButton_down event of your dialog, then test if the mouse click is on your static control.
2. use CEdit control in the read-only mode. This time, catch the setfocus event of the edit control.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top