Preventing OnLButtonUp handler beign called in the CFormView in certain conditions.
-
Hi, I have a form view derived from CFormView on which I have placed several buttons,and onclick of the button i.e in LButtonUp handler, it takes the user to a different screen. It takes some time to show up the new screen as some thread processing has to take place for showing up the new screen. After the user clicks on a button and while the processing is going on, if the user clicks on another button my program is asserting. Hence I want to prevent the clicks on other buttons when the processing is going on. The buttons on my view are CBitmap buttons and totally there are 30 buttons. So when the user clicks on one button, I want to prevent him from clcking on all other 29 buttons, in other words I want to prevent the handlers in LButtonDown and LButtonUp from getting called. I want to revert back to normal state when the for view is shown initially and if for any reason the handler function returns and the user has to stay in the current view itself. Can anyone please help me to do this. Thanks Madhavi.
-
Hi, I have a form view derived from CFormView on which I have placed several buttons,and onclick of the button i.e in LButtonUp handler, it takes the user to a different screen. It takes some time to show up the new screen as some thread processing has to take place for showing up the new screen. After the user clicks on a button and while the processing is going on, if the user clicks on another button my program is asserting. Hence I want to prevent the clicks on other buttons when the processing is going on. The buttons on my view are CBitmap buttons and totally there are 30 buttons. So when the user clicks on one button, I want to prevent him from clcking on all other 29 buttons, in other words I want to prevent the handlers in LButtonDown and LButtonUp from getting called. I want to revert back to normal state when the for view is shown initially and if for any reason the handler function returns and the user has to stay in the current view itself. Can anyone please help me to do this. Thanks Madhavi.
Just disable the buttons when the user is not allowed to use them. Christian Graus - Microsoft MVP - C++
-
Just disable the buttons when the user is not allowed to use them. Christian Graus - Microsoft MVP - C++
Hi, Thanks for ur inputs. But it's not a CButton. It is CBitmap which is drawn on the view using BitBlt. I am handling LButtonDown and LButtonUp on these bitmaps by finding whether the point of click is inside the bitmap rectangle or not. Please let me know how I can disable a CBitmap? Thanks Madhavi
-
Hi, Thanks for ur inputs. But it's not a CButton. It is CBitmap which is drawn on the view using BitBlt. I am handling LButtonDown and LButtonUp on these bitmaps by finding whether the point of click is inside the bitmap rectangle or not. Please let me know how I can disable a CBitmap? Thanks Madhavi
Well, if you handle the click, then deciding not to handle it is trivial, surely ? You can't 'disable a bitmap', that is, you can't stop your code from handling the click, nor can you automatically make it look disabled. You need to draw a different bitmap if you want to show it's disabled, and then just ignore the click in your own code. Christian Graus - Microsoft MVP - C++