CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Threaded View

  1. #1
    Join Date
    Sep 2001
    Posts
    49

    Clicking on a menu item does not cause the object validate to trigger, why?

    As simple as I could put it in a VB program, the msgbox in the Validate event does not get fired when you click on the menu item "Print" which calls the Click event. I expect the Validate event to get fired but it doesn't. It gets fired only when you click on the command button.

    I understand that the textbox object has not lost its focus. How do I get it to lost its focus so that the Validate event can get fired. I have about 200+ objects that I create and destroy on the fly, depending on the user's action. I need something simple or quick to solve this.

    Any ideas on how to get it fired? Otherwise I may have to remove the menu items. The reason why I want it fired is that so whatever the textbox contains can get assigned to a class object property before it gets printed. It is assigned in the Validate event if it passes the requirements. Not all events do some validation checking prior to assigning the value to the class object. Like I said I have over 200 objects (or class properties) so I can't know which one is loaded or not on the spot. (Trying to do so is so much work, especially when I don't know which object has the focus. I don't really need to know it.)

    Clicking on the menu item is similar to the command button CauseValidation = False. I want it to be "True"

    To give you a small info on the project, it is a report generator program. It has over 50 reports, depending on the report the user selects, it will display a small number of options for that report. Many reports share some of the same options (that's why I have a class module) When the user wants to print the report, the object that currently has focus doesn't fire the Validate event if you choose the menu item. That's why I don't which report option has the focus.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured