0

I have problems with button PerformClick().

In my main form I'm loading another form 30 times:

for (int i = 0; i < iloscIteracji; i++)
{
    pso _pso = new pso(czastki, punkty, 1, 3, 3,1);
    _pso.Show();
}

then in Form1_Load I'm checking settings of constructor

    if (ktoraMetoda == 1)
    {
        button1.PerformClick();
        radioButton1.Checked = true;
        textBox1.Text = "100";
        button3.PerformClick();

    }

but the problem is that in button3_click I have 2 methods which I want to run:

znajdzNajlepszych();
zmienKolory();

and that doesn't work. I tried to put breakpoint on those 2 methods but the app is just leaving them.

Any suggestions?

Kevin Bedell
  • 13,254
  • 10
  • 78
  • 114
user13657
  • 745
  • 3
  • 17
  • 36
  • 1
    So when you say "That doesn't work," what do you mean? The methods are not getting called? It's throwing an exception? – Robert Harvey Jun 19 '12 at 16:54
  • Is this Windows Forms? ASP.NET? WPF? – Jon Skeet Jun 19 '12 at 16:54
  • I think you need to show us a little more code. Show us your `znajdzNajlepszych();` declaration, and the code block that calls it. – Robert Harvey Jun 19 '12 at 16:56
  • possible duplicate of [VS2010 does not show unhandled exception message in a WinForms Application on a 64-bit version of Windows](http://stackoverflow.com/questions/4933958/vs2010-does-not-show-unhandled-exception-message-in-a-winforms-application-on-a) – Hans Passant Jun 19 '12 at 17:27

0 Answers0