Results 1 to 7 of 7

Thread: How to keep a frame refreshed

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2002
    Location
    new zealand (kiwi)!
    Posts
    202

    How to keep a frame refreshed

    I have a frame (with controls in it) on a form.
    When I switch processes (alt Tab) and come back again, the form shows but not the frame.
    How can I switch back to the process, keeping the frame visible?

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: How to keep a frame refreshed

    In the Form_Activate event you can refresh the form.
    VB Code:
    1. Private Sub Form_Activate()
    2.     Me.Refresh
    3. End Sub
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jul 2002
    Location
    new zealand (kiwi)!
    Posts
    202

    Re: How to keep a frame refreshed

    BUT does this event fire when you Alt Tab back to the process?
    (The frame is on its own Form, which seems to close when you Alt Tab away from the process. I Dont what the form to put an icon in the task bar [which I think is the only way to avoid this problem]?)

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: How to keep a frame refreshed

    Ah, I see as it states:
    Moving the focus to or from an object in another application doesn't trigger either event.
    So it wont fire if your alt tabbing out of your application.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jul 2002
    Location
    new zealand (kiwi)!
    Posts
    202

    Re: How to keep a frame refreshed

    so how does one keep the form active/visible after an alt tab ???
    This seems a fundimental requirement in most apps...
    The whole point of windows is multitasking so you cane switch between apps
    without altering either app's window!

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: How to keep a frame refreshed

    I couldnt duplicate the painting issue. What else does your form do?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Jul 2002
    Location
    new zealand (kiwi)!
    Posts
    202

    Re: How to keep a frame refreshed

    If you make a simple program which has two forms
    and in form1 it does

    form2.Show

    If form2 has 'show in taskbar' = false
    then if you Alt Tab away & back to the program, form2 is not shown

    i.e You can't leave and return to the program exactly as it was....

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