form.activated in vb.net
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: form.activated in vb.net

Hybrid View

  1. #1
    Join Date
    Jun 2010
    Posts
    18

    form.activated in vb.net

    Hi,
    I am trying to migrate a vb6.0 application to vb.net. I have a major issue while executing the code under form.activated and form.deactivate. There is a difference in behaviour between form.activate in vb6.0 and form.activated in vb.net. How can I simulate the behaviour of vb version in vb.net.

    I have read that the form.activated fires even when the control goes to a different application and comes back.

    Any solutions to this problem.

    Thank you.

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,097

    Re: form.activated in vb.net

    Quote Originally Posted by nidabp View Post
    I have read that the form.activated fires even when the control goes to a different application and comes back.
    Nope. This fires whenever a Form is activated, not the application as such

  3. #3
    Join Date
    Jun 2010
    Posts
    18

    Re: form.activated in vb.net

    Hi,
    I got to read from the below link;

    http://vbmigration.codearchitects.co...ols.aspx?Id=10


    that there is some difference in which the form.activate(vb6) and form.activated(vb.net) behave

    Thanx

  4. #4
    Join Date
    Jan 2006
    Location
    Chicago, IL
    Posts
    14,999

    Re: form.activated in vb.net

    Well, in VB6, move off a form and CLICK and the other goes to the top. It's the same in VB.Net. The bottom form won't ACTIVATE until you click it, or TAB to it (in a DIFFERENT app)
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  5. #5
    Join Date
    Jun 2010
    Posts
    18

    Re: form.activated in vb.net

    Hi,
    Sorry, I am not able to get you. what I mean is:

    You have a forms application(vb.net) with 2 forms and another application(eg: outlook client )opened. What I am trying to achieve is: form1.activate event should fire when the control comes only form2 and not from the other application(egutlook client). It should be the same with the deactivate event. It happens like this in vb6 but not in vb.net

    Thanx

  6. #6
    Join Date
    Jan 2006
    Location
    Chicago, IL
    Posts
    14,999

    Re: form.activated in vb.net

    You'd have to intercept Window calls, to prevent Windows form passing control to your app, unless it came from where you expected it. Not too simple, though
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

Tags for this Thread

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center