Cancel Click Event

  • Thread starter Thread starter MDB
  • Start date Start date
M

MDB

Hello All, I am trying to figure out how to cancel the click event of a
tabcontrol. For example, when a tab is clicked I call a tb_Click event.
Inside this event I check for items and if they don't exist, I want to
cancel the click so they do not move on to the new tab they selected. Is
this possible?
 
Thanks but that will not work in my case, if what I am checking fails, I
actually open a new form and display it to the user however, after I display
it, since a tab page was selected to goes back to the form with the tab
control and the form I need displayed loses its focus.
 
You can't cancel the click, you must intercept it and throw it away before
it reaches the control. Use an IMessageFilter implementation to pre-process
the click and determine if it should pass it on to the control.

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate
 
Back
Top