RE: Click a button on the form via code?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I forgot to mention, the code in my previous reply is for if you are making
that call from another thread and want the call to occur within the main
thread.

Otherwise, if both are the same thread, you can simply call the function
from within the class with:

btnExit_Click(this, EventArgs.Empty);

Brendan

"vbMark" wrote:

> I want to call this function via code:
>
>
> private void btnExit_Click(object sender, System.EventArgs e)
> {
> Close();
> }
>
>
> How do I do this?
>
> Thanks!
>
> --
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> http://www.vbmark.com
> Get freeware, learn things, make money.
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>
.



Relevant Pages

  • RE: Click a button on the form via code?
    ... Your code works fine but did not solve my bigger problem ... >> Get freeware, learn things, make money. ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)
  • Click a button on the form via code?
    ... private void btnExit_Click(object sender, System.EventArgs e) ... Get freeware, learn things, make money. ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: My app wont close programatically
    ... It goes back to Static Void Main ... Get freeware, learn things, make money. ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Todo Software
    ... I don't think this goes only for people with "less" money. ... > It's also very understandable that someone that sells components ... lot of freeware things, but I doubt someone else is feeling threatened by ... generaly valid answers to questions about human nature. ...
    (borland.public.delphi.thirdpartytools.general)
  • RE: My app wont close programatically
    ... Brendan ... >>> public frmMain() ... >>> Get freeware, learn things, make money. ...
    (microsoft.public.dotnet.languages.csharp)