public void createButtons(MyFlowLayoutPanel flowLayoutPanelForControls, Form form2)
        {
            Button btnGenerateNicks = new Button();
            btnGenerateNicks.Name = "btnGenerateNicks";
            btnGenerateNicks = setButtons(form2,btnGenerateNicks);
            btnGenerateNicks.Text = "generuj přezdívky";
            btnGenerateNicks.Click += new EventHandler(btnGenerateNicksClick);
            flowLayoutPanelForControls.Controls.Add(btnGenerateNicks);

            //Button btnEditEmails = new Button();
            //btnEditEmails.Name = "btnEditEmails";
            //btnEditEmails = setButtons(form2, btnEditEmails);
            //btnEditEmails.Text = "vypiš emaily";
            //btnEditEmails.Click += new EventHandler(btnEditEmailsClick);
            //flowLayoutPanelForControls.Controls.Add(btnEditEmails);

            Button btnMakeRaceRdy = form2.Controls.Find("bttnMakeRaceRdy", true).FirstOrDefault() as Button;
            btnMakeRaceRdy.Name = "btnMakeRaceRdy";
            btnMakeRaceRdy = setButtons(form2, btnMakeRaceRdy);
            btnMakeRaceRdy.Text = "spusť závod";
            flowLayoutPanelForControls.Controls.Add(btnMakeRaceRdy);

            Button btnPrintResults = form2.Controls.Find("printBttn", true).FirstOrDefault() as Button;
            btnPrintResults.Name = "btnPrintResults";
            btnPrintResults = setButtons(form2, btnPrintResults);
            btnPrintResults.Text = "tisk výsledku";
            btnPrintResults.Enabled = false;
            flowLayoutPanelForControls.Controls.Add(btnPrintResults);

            //Button btnRestartApp = new Button();
            //btnRestartApp.Name = "btnRestartApp";
            //btnRestartApp = setButtons(form2, btnRestartApp);
            //btnRestartApp.Text = "nový závod";
            //btnRestartApp.Click += new EventHandler(btnRestartAppClick);
            //flowLayoutPanelForControls.Controls.Add(btnRestartApp);

            Bitmap bmp = new Bitmap(btnPrintResults.Width, btnPrintResults.Height);
            using (Graphics g = Graphics.FromImage(bmp))
            {
                Rectangle r = new Rectangle(0, 0, bmp.Width, bmp.Height);
                using (LinearGradientBrush br = new LinearGradientBrush(
                                                    r,
                                                    Color.DeepSkyBlue,
                                                    Color.White,
                                                    LinearGradientMode.ForwardDiagonal))
                {
                    g.FillRectangle(br, r);
                }
            }

            btnGenerateNicks.BackgroundImage = bmp;
               // btnRestartApp.BackgroundImage = bmp;
            btnPrintResults.BackgroundImage = bmp;
            btnMakeRaceRdy.BackgroundImage = bmp;
        }
 public void CreateFlowlayoutpanel(Form form2, List<Control> lstUserControlRacers)
 {
     pfc.AddFontFile(@"Fonts\OpenSans-Semibold.ttf");
     NewPubliclstUserControlRacers = lstUserControlRacers;
     MyFlowLayoutPanel flowLayoutPanelForControls = new MyFlowLayoutPanel();
      flowLayoutPanelForControls.Location = new Point(48,50);
       //  flowLayoutPanelForControls.Dock = DockStyle.Right;
     flowLayoutPanelForControls.Size = new Size(form2.Width,48);
     flowLayoutPanelForControls.FlowDirection = FlowDirection.LeftToRight;
     flowLayoutPanelForControls.BorderStyle = BorderStyle.None;
     //Button sdfasd = new Button();
     //sdfasd.Size = new Size(20, 20);
     //flowLayoutPanelForControls.Controls.Add(sdfasd);
     createButtons(flowLayoutPanelForControls,form2);
     form2.Controls.Add(flowLayoutPanelForControls);
 }