コード例 #1
0
 public void InitializeComponent()
 {
     this.button1 = new System.Windows.Forms.Button();
     this.SuspendLayout();
     //
     // button1
     //
     this.button1.Location = new System.Drawing.Point(13, 13);
     this.button1.Name     = "button1";
     this.button1.Size     = new System.Drawing.Size(75, 23);
     this.button1.TabIndex = 0;
     this.button1.Text     = "Закрити";
     this.button1.UseVisualStyleBackColor = true;
     this.button1.Click += new System.EventHandler(this.buttonClose_Click);
     //
     // ShowAllBooks2
     //
     this.ClientSize = new System.Drawing.Size(284, 261);
     this.Controls.Add(this.button1);
     this.Name = "ShowAllBooks2";
     this.ResumeLayout(false);
     //
     for (int i = 0; i < AllBooks.BookList.Count; i++)
     {
         Book book = AllBooks.BookList[i];
         //Button button = new Button();
         Button button = new ButtonDeleteBook(book);
         button.Text     = "Видалити цю книгу";
         button.Location = new Point(16, 50 * i + 100);
         button.Height   = 40;
         button.Width    = 100;
         button.Tag      = i;
         this.Controls.Add(button);
         //назва книги
         Label tempLab = new Label();
         tempLab.Text     = "Назва книги: " + book.title + "\n" + "Автор книги: " + book.author;
         tempLab.Location = new Point(120, 50 * i + 105);
         tempLab.Height   = 40;
         tempLab.Width    = 400;
         this.Controls.Add(tempLab);
     }
 }
コード例 #2
0
ファイル: ShowAllBooks.cs プロジェクト: roughterr/session2015
 public void InitializeComponent()
 {
     this.button1 = new System.Windows.Forms.Button();
     this.SuspendLayout();
     //
     // button1
     //
     this.button1.Location = new System.Drawing.Point(13, 13);
     this.button1.Name = "button1";
     this.button1.Size = new System.Drawing.Size(75, 23);
     this.button1.TabIndex = 0;
     this.button1.Text = "Закрити";
     this.button1.UseVisualStyleBackColor = true;
     this.button1.Click += new System.EventHandler(this.buttonClose_Click);
     //
     // ShowAllBooks2
     //
     this.ClientSize = new System.Drawing.Size(284, 261);
     this.Controls.Add(this.button1);
     this.Name = "ShowAllBooks2";
     this.ResumeLayout(false);
     //
     for (int i = 0; i < AllBooks.BookList.Count; i++)
     {
         Book book = AllBooks.BookList[i];
         //Button button = new Button();
         Button button = new ButtonDeleteBook(book);
         button.Text = "Видалити цю книгу";
         button.Location = new Point(16, 50 * i + 100);
         button.Height = 40;
         button.Width = 100;
         button.Tag = i;
         this.Controls.Add(button);
         //назва книги
         Label tempLab = new Label();
         tempLab.Text = "Назва книги: " + book.title + "\n" + "Автор книги: " + book.author;
         tempLab.Location = new Point(120, 50 * i + 105);
         tempLab.Height = 40;
         tempLab.Width = 400;
         this.Controls.Add(tempLab);
     }
 }