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 8413429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:55:18+00:00 2026-06-10T00:55:18+00:00

I have a screenshot application where a user can pass command line arguments, and

  • 0

I have a screenshot application where a user can pass command line arguments, and based on those arguments will determine the behaviour of the form.

I am trying to take a screenshot after the form has loaded, however I have the functionality to do this after InitializeComponent();. Like so-

if (counts > 0)
        {
            generateScreenshotButton_Click(null, null);

            button2_Click(null, null);
        }

My problem being these functions are firing before the form has loaded. Therefore the screen shot is blank. How can I resolve this?

  • 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-06-10T00:55:19+00:00Added an answer on June 10, 2026 at 12:55 am

    Add Load event in your Form.cs file.

    There is a difference between InitializeComponent and Form Load. See What does InitializeComponent() do, and how does it work in WPF? It is for WPF but is same in Windows Forms.

    Try this code:

    public Form1()
            {
                InitializeComponent(); //this is the InitializeComponent method. this This method locates a URI to the XAML for the Window/UserControl that is loading, and passes it to the System.Windows.Application.LoadComponent() static method. 
                this.Load += new EventHandler(Form1_Load); //this create Load Form event
            }
    
            void Form1_Load(object sender, EventArgs e) //after your form is completely loaded, your program will run the code from here...
            {
                //your code goes here
            }
    

    Hope that I helped you.

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

Sidebar

Related Questions

Currently, I have an application, which will save a temporary screenshot, and let user
I'm creating an application (Windows Form) that allows the user to take a screenshot
I have a Winforms application that the user uses to take a region based
I have an application in which the user can draw some points with the
I am developing an application in which user can purchase any image he likes.
I'm working on my own private Windows desktop application user interface framework based on
I have a sign-up form in my application with several UITextFields. In order to
I have a C sharp console application that captures a screenshot of a MS
I have an entity relationship setup in my mvc2 application such that each user
I have ten check box in the application. if the user press the checkbox

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.