Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7074059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:00:19+00:00 2026-05-28T06:00:19+00:00

I have this code: Window w = // something w.Loaded += // some code

  • 0

I have this code:
Window w = // something
w.Loaded += // some code to take a screenshot of the window
w.Show();

The Loaded event fires before the window is fully loaded and I get this image:
Window screenshot

I could add a Thread.Sleep or something after w.Show() and before the screenshot but I need to run this piece of code for hundreds of windows.
My question is: Is there another event that fires when the window is fully loaded? or some way to achieve this without putting the thread to sleep.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:00:20+00:00Added an answer on May 28, 2026 at 6:00 am

    Looking into Object Lifetime Events article in MSDN you can find:

    The Loaded event is raised before the final rendering, but after the
    layout system has calculated all necessary values for rendering.
    Loaded entails that the logical tree that an element is contained
    within is complete, and connects to a presentation source that
    provides the HWND and the rendering surface.

    You should try some alternative events which are not exactly suited for your need. You should try in following order:

    • Window.ContentRendered
    • UIElement.LayoutUpdated
    • Window.Activated

    Take note that these events may fire multiple times during lifetime of your window, so write your application with that in mind.

    WPF is data driven UI architecture and it’s not very pleasant to work with in a way we are used to in WinForms. As someone smarter than me once said, WPF makes hard things trivial and trivial things hard.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this form submit code: Event.observe(window, 'load', init, false); function init() { Event.observe('addressForm',
I have this code: public class Window extends JFrame { public Window(){ ... JButton
I have a greasemonkey user script with this single line of code... window.close(); but
I have added some code which compiles cleanly and have just received this Windows
I have this code: chars = #some list try: indx = chars.index(chars) except ValueError:
So I have this code (from the gracious help from this site!) window.onload =
I have this code window.fbAsyncInit = function() { FB.init({ appId: 'balblablablbal', status: true, cookie:
In my WPF Window_Loaded event handler I have something like this: System.Threading.Tasks.Task.Factory.StartNew(() => {
Conditions: Windows 98 SE WMI not available I have code that looks like this,
I have this code in jQuery, that I want to reimplement with the prototype

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.