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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:14:59+00:00 2026-06-04T21:14:59+00:00

How could I execute an event, without it actually happening? For example, how would

  • 0

How could I execute an event, without it actually happening?

For example, how would I execute a button1_Click() event in code, without clicking the button?

The problem is that I have a WebClient, which doewnloads lists of files.
Each time it finishes downloading a file it executes a DownloadFileCompleted event, which then downloads the next file.

However, some files aren’t downloaded (all in plan), so the event is not executed. How could I execute it?
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-06-04T21:15:00+00:00Added an answer on June 4, 2026 at 9:15 pm

    Just insert all code present in the event handler in a separate function, like

    private void button1_click(...)
    {
        func(...)
    }
    
    
    public void func(...)
    {
        //even handler code
    }
    

    and if you don’t what to raise an event, or can’t, just call

    func(...)
    

    I personally against calling event handler esplicitly, but prefer this approach. To me seems more clear code structure.

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

Sidebar

Related Questions

I have a plugin that uses the .live method (now deprecated) to execute code
I have a large project that executes without problem when not debugging (even when
I get the following Nhiberante error, but have no idea why: could not execute
Below you could see template of SQL script that i'm trying to execute on
This bit of code is taking almost a half second to execute. Could somebody
What is the proper technique to have ThreadA signal ThreadB of some event, without
I have a Rails script that I would like to run daily. I know
java.lang.IllegalStateException: Could not execute method of the activity . I am new to Android.
i am getting this error failed to execute request because the app-domain could not
i wonder what this query means: $blogPost = Doctrine_Query::create()->from('BlogPost p')->where('p.slug = ?', 'doctrine-released')->execute(); could

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.