Results 1 to 2 of 2

Thread: Stop Form Activation

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2006

    Stop Form Activation

    I know what I want to do, but do not know how to do it.

    I have a form that does not have the focus. When I click a button on the form, I want to stop the form from getting the focus, but still process the event.
    Visual Studio .NET 2005/.NET Framework 2.0

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Sydney, Australia

    Re: Stop Form Activation

    It's not possible because to raise a Click event from the UI a Button must first receive focus. Your only option would be to use APIs to refocus the form that previously had the focus, but determining which form that was would be the tricky part. You'd have to somehow follow the focus as it went from form to form outside of your app. You could use a Timer to check which form has focus all the time but it would be better if you could handle an event or use some sort of notification instead. I don't know if maybe your form would receiv a message each time the focus changes if it's not involved.

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