Пример #1
0
 private void InitializerSeatMap()
 {
     System.Threading.Thread t = new System.Threading.Thread(() =>
     {
         this.Invoke(new Action(() => { FLPMap.SuspendLayout(); }));
         Label lblSeat = new Label();
         for (int row = 1; row <= Program.AuditoriumSeatRowsCount; ++row)
         {
             for (int col = 1; col <= Program.AuditoriumSeatColumnsCount; ++col)
             {
                 lblSeat          = new Label();
                 lblSeat.Text     = string.Format("{0:00}-{1:00}", row, col);
                 lblSeat.Name     = lblSeat.Text;
                 lblSeat.AutoSize = true;
                 lblSeat.Margin   = new Padding(6);
                 lblSeat.Tag      = new Point(row, col);
                 lblSeat.Cursor   = Cursors.Hand;
                 lblSeat.Click   += LblSeat_Click;
                 this.Invoke(new Action(() => { FLPMap.Controls.Add(lblSeat); }));
             }
             this.Invoke(new Action(() => { FLPMap.SetFlowBreak(lblSeat, true); }));
         }
         this.isInit = true;
         this.Invoke(new Action(() => { FLPMap.ResumeLayout(); }));
     });
     t.Start();
 }