CStatic text box
-
Hi, I've got a static text box on my dialog, I've renamed the text box which then allows me to access its events. I've added an on click event which has automatically created an 'OnStnClicked' method and added an entry to the message map. However when I run the code the 'OnStnClicked' doesn't get called. Do I need to add change any of the properties on the text control to allow this method to be called? (Double clicking on the text whilst in design mode takes me to the created method) TIA, Andy
-
Hi, I've got a static text box on my dialog, I've renamed the text box which then allows me to access its events. I've added an on click event which has automatically created an 'OnStnClicked' method and added an entry to the message map. However when I run the code the 'OnStnClicked' doesn't get called. Do I need to add change any of the properties on the text control to allow this method to be called? (Double clicking on the text whilst in design mode takes me to the created method) TIA, Andy
-
Hi, I've got a static text box on my dialog, I've renamed the text box which then allows me to access its events. I've added an on click event which has automatically created an 'OnStnClicked' method and added an entry to the message map. However when I run the code the 'OnStnClicked' doesn't get called. Do I need to add change any of the properties on the text control to allow this method to be called? (Double clicking on the text whilst in design mode takes me to the created method) TIA, Andy
If you add the SS_NOTIFY then the parent window will receive a STN_CLICKED notification (in a WM_COMMAND message). You can set the SS_NOTIFY style in the control's property window by setting the Notify property to true. You can catch the message in the parent with afx_msg void OnStaticClicked(); ... ON_CONTROL(STN_CLICKED, IDC_MYSTATIC, OnStaticClicked) ... void CMyDialog::OnStaticClicked() { // do something here }
"Go that way, really fast. If something gets in your way, turn."
-
Hi, I've got a static text box on my dialog, I've renamed the text box which then allows me to access its events. I've added an on click event which has automatically created an 'OnStnClicked' method and added an entry to the message map. However when I run the code the 'OnStnClicked' doesn't get called. Do I need to add change any of the properties on the text control to allow this method to be called? (Double clicking on the text whilst in design mode takes me to the created method) TIA, Andy