Hello Patrick,
Thank you for helping. Your response puzzles me a bit as I see nothing wrong with putting a modal dialog box in an event handler especially if it makes sense to the program (you mentioned the OnClick event but that is also an event handler). Please explain your reasoning further.
What I am trying to accomplish is a confirmation when the user changes the date on a form. As stated, I have a DTPicker control which is bound to the Report Date on a data submission form. When the user changes the Report Date (by clicking a different date) we want to confirm the intent and ask 3 questions: 1) Do you want to create a new form with the new date? 2) Do you want to change the date for the current form? 3) Do you want to cancel? This is important as this is going to a database. If they submit the form and then change the date on the current form to re-submit it will change the Report Date in the database for what was just submitted; hence, the question of creating a new form (for a new submission).
Interestingly, if I change the report date manually (by typing in the new date into the DTPicker) and then hitting TAB everything works as expected, it is just when I point and click with the mouse.
I suppose my alternative is to redo my program logic to use the AfterChange event handler instead, but, according to you, that is also bad as it is also an event handler. Recall also that the MessageBox.Show() method (which is also a modal dialog box) works correctly in the BeforeChange event handler. I also don't see any other appropriate Rule mechinisms.
Please let me know if you see a viable alternative or what might be happening which is causing the mouse events to interfere. Somehow, all is made righteous when using MessageBox.Show().
Thank you,
Tony