Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    Mar 2001
    Location
    Texas
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Form Focus (VB.NET)

    I have a very simple VB.NET application. It has a form with 4 check boxes and an Exit button. When a check box is checked it opens a second form. This form builds some crystal report pdfs and closes.

    I want to reset the check box when the first form receives focus again but I can't find out what to check to make this happen.

    Thanks,

    Mary

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Focus (VB.NET)

    Hi Mary,

    There are several events in which you could place the logic and command for this action (in the first form). Check the Visual Studio help topics on the Activated, Enter, and GotFocus events to see which will be best in your situation. The Activated event is a member of the System.Windows.Forms.Form class, while the Enter and GotFocus are inherited to the Form via the Control object. (Activated will probably do the trick for you.)

    Once you decide which event to use, you'll want to include some logic (If/Then) to make sure the circumstances meet your approval before clearing the checkboxes.

    Hope this helps.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Form Focus (VB.NET)

    Another option would be to use buttons instead of checkboxes to open the other forms. Buttons don't require resetting.
    Charlotte

  4. #4
    Lounger
    Join Date
    Mar 2001
    Location
    Texas
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Focus (VB.NET)

    Thanks, Activate worked. I had tried it before with a msgbox in it and it fired everytime I clicked on the message box. After I received your email, I just put in what I really wanted and it works like a charm.

    Thanks again!

    Mary

  5. #5
    Lounger
    Join Date
    Mar 2001
    Location
    Texas
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Focus (VB.NET)

    Thanks for your reply. Your suggestion would also work but I thought I wanted check boxes.

    Mary

Posting Permissions

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