Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- ///FORM1.CS
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace PegSolitaire
- {
- public partial class Form1 : Form
- {
- static bool clicked = false;
- static Point click1, click2;
- static State firstClick;
- public static Image empty_img, occupied_img, temp_img;
- public static Color empty_col = Color.Black, occupied_col = Color.BlueViolet, temp_col = Color.DarkGray, backcolor = Color.DodgerBlue;
- public static bool picBack = false;
- string moves = "";
- public Form1()
- {
- InitializeComponent();
- if (planszaToolStripMenuItem.Checked)
- {
- try
- {
- empty_img = new Bitmap("empty.png");
- occupied_img = new Bitmap("occupied.png");
- temp_img = new Bitmap("temp.png");
- }
- catch (ArgumentException e)
- {
- MessageBox.Show("Nie znaleziono plików! \nWskaż katalog z plikami: \"occupied.png\", \"empty.png\" oraz \"temp.png\".");
- FolderBrowserDialog dir = new FolderBrowserDialog();
- dir.ShowDialog();
- string cat = dir.SelectedPath;
- try
- {
- empty_img = new Bitmap(cat + "/empty.png");
- occupied_img = new Bitmap(cat + "/occupied.png");
- temp_img = new Bitmap(cat + "/temp.png");
- planszaToolStripMenuItem.Checked = true;
- }
- catch (ArgumentException e1)
- {
- MessageBox.Show("Błąd!");
- empty_img = null;
- occupied_img = null;
- temp_img = null;
- }
- }
- }
- else
- {
- empty_img = null;
- occupied_img = null;
- temp_img = null;
- }
- this.BackColor = backcolor;
- board(7, 7);
- plikToolStripMenuItem_Click(new object(), new EventArgs());
- }
- public void button5_Click(object sender, EventArgs e)
- {
- this.BackColor = backcolor;
- redraw();
- }
- private void board(int x, int y)
- {
- cofnijToolStripMenuItem.Enabled = false;
- tableLayoutPanel1.Location = new System.Drawing.Point(12, 27);
- tableLayoutPanel1.RowCount = x;
- tableLayoutPanel1.ColumnCount = y;
- tableLayoutPanel1.Size = new System.Drawing.Size(550, 550);
- for (int i = 0; i < x; i++)
- tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28571F));
- for (int i = 0; i < y; i++)
- tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 14.28571F));
- for (int i = 0; i < x; i++)
- {
- for (int j = 0; j < y; j++)
- {
- if ((i == 0 || i == 1 || i == 5 || i == 6) && (j == 0 || j == 1 || j == 5 || j == 6))
- {
- State status = new State(State.state.Unavaliable, new Size((int)(tableLayoutPanel1.GetColumnWidths()[0] * 0.9), (int)(tableLayoutPanel1.GetRowHeights()[0] * 0.9)));
- tableLayoutPanel1.Controls.Add(status, i, j);
- continue;
- }
- else
- {
- State status = new State(State.state.Occupied, new Size((int)(tableLayoutPanel1.GetColumnWidths()[0] * 0.9), (int)(tableLayoutPanel1.GetRowHeights()[0] * 0.9)));
- status.AddClickHandler(field_Click);
- tableLayoutPanel1.Controls.Add(status, i, j);
- }
- }
- }
- }
- public void field_Click(object sender, EventArgs e)
- {
- PictureBox tmp = (PictureBox)sender;
- State temp = (State)tmp.Parent;
- if (!clicked)
- {
- if (temp.GetState() == State.state.Empty) return;
- firstClick = temp;
- temp.SetState(State.state.Temp);
- click1 = new Point(tableLayoutPanel1.GetPositionFromControl(temp).Column, tableLayoutPanel1.GetPositionFromControl(temp).Row);
- clicked = true;
- }
- else
- {
- click2 = new Point(tableLayoutPanel1.GetPositionFromControl(temp).Column, tableLayoutPanel1.GetPositionFromControl(temp).Row);
- if (ruch(click1, click2, tableLayoutPanel1))
- {
- clicked = false;
- if (sprawdz() > 0)
- {
- MessageBox.Show("Gratulacje!");
- cofnijToolStripMenuItem.Enabled = false;
- for (int i = 0; i < tableLayoutPanel1.ColumnCount; i++)
- for (int j = 0; j < tableLayoutPanel1.RowCount; j++)
- {
- State temp1 = (State)tableLayoutPanel1.GetControlFromPosition(i, j);
- temp1.RemoveHandler(field_Click);
- }
- }
- else if (sprawdz() < 0)
- {
- MessageBox.Show(":(\n Spróbuj jeszcze raz");
- cofnijToolStripMenuItem.Enabled = false;
- for (int i = 0; i < tableLayoutPanel1.ColumnCount; i++)
- for (int j = 0; j < tableLayoutPanel1.RowCount; j++)
- {
- State temp1 = (State)tableLayoutPanel1.GetControlFromPosition(i, j);
- temp1.RemoveHandler(field_Click);
- }
- }
- }
- else
- {
- clicked = false;
- firstClick.SetState(State.state.Occupied);
- }
- }
- }
- int sprawdz()
- {
- int pawn = 0;
- bool pawn_alone = true;
- for (int i = 0; i < tableLayoutPanel1.ColumnCount; i++)
- for (int j = 0; j < tableLayoutPanel1.RowCount; j++)
- {
- State field = (State)tableLayoutPanel1.GetControlFromPosition(i, j);
- if (field.GetState() == State.state.Occupied)
- pawn++;
- }
- if (pawn == 1)
- return 1;
- if (pawn > 1)
- {
- for (int i = 0; i < tableLayoutPanel1.ColumnCount; i++)
- for (int j = 0; j < tableLayoutPanel1.RowCount; j++)
- {
- State field = (State)tableLayoutPanel1.GetControlFromPosition(i, j);
- if (field.GetState() == State.state.Occupied)
- {
- try
- {
- State field1 = (State)tableLayoutPanel1.GetControlFromPosition(i + 1, j);
- if (field1.GetState() != State.state.Occupied) ;
- else pawn_alone = false;
- }
- catch (ArgumentException e) { }
- catch (NullReferenceException e1) { }
- try
- {
- State field2 = (State)tableLayoutPanel1.GetControlFromPosition(i - 1, j);
- if (field2.GetState() != State.state.Occupied) ;
- else pawn_alone = false;
- }
- catch (ArgumentException e) { }
- catch (NullReferenceException e1) { }
- try
- {
- State field3 = (State)tableLayoutPanel1.GetControlFromPosition(i, j - 1);
- if (field3.GetState() != State.state.Occupied) ;
- else pawn_alone = false;
- }
- catch (ArgumentException e) { }
- catch (NullReferenceException e1) { }
- try
- {
- State field4 = (State)tableLayoutPanel1.GetControlFromPosition(i, j + 1);
- if (field4.GetState() != State.state.Occupied) ;
- else pawn_alone = false;
- }
- catch (ArgumentException e) { }
- catch (NullReferenceException e1) { }
- }
- }
- if (pawn_alone) return -1;
- else return 0;
- }
- return 0;
- }
- bool ruch(Point p1, Point p2, TableLayoutPanel table1)
- {
- int a = p1.X, b = p1.Y, c = p2.X, d = p2.Y;
- State temp1 = (State)tableLayoutPanel1.GetControlFromPosition(a, b);
- State temp2 = (State)tableLayoutPanel1.GetControlFromPosition(c, d);
- State temp3 = (State)tableLayoutPanel1.GetControlFromPosition((a + c) / 2, b);
- State temp4 = (State)tableLayoutPanel1.GetControlFromPosition(a, (b + d) / 2);
- if (temp2.GetState() != State.state.Empty || temp1.GetState() != State.state.Temp) return false;
- if (a == c && Math.Abs(b - d) == 2)
- {
- if (temp4.GetState() == State.state.Empty) return false;
- temp4.SetState(State.state.Empty);
- temp1.SetState(State.state.Empty);
- temp2.SetState(State.state.Occupied);
- if (cofnijToolStripMenuItem.Enabled == false)
- cofnijToolStripMenuItem.Enabled = true;
- moves += a.ToString() + b.ToString() + c.ToString() + d.ToString();
- return true;
- }
- else if (b == d && Math.Abs(a - c) == 2)
- {
- if (temp3.GetState() == State.state.Empty) return false;
- temp3.SetState(State.state.Empty);
- temp1.SetState(State.state.Empty);
- temp2.SetState(State.state.Occupied);
- if (cofnijToolStripMenuItem.Enabled == false)
- cofnijToolStripMenuItem.Enabled = true;
- moves += a.ToString() + b.ToString() + c.ToString() + d.ToString();
- return true;
- }
- else return false;
- }
- private void plikToolStripMenuItem_Click(object sender, EventArgs e)
- {
- clicked = false;
- tableLayoutPanel1.Dispose();
- tableLayoutPanel1 = new TableLayoutPanel();
- this.Controls.Add(tableLayoutPanel1);
- board(7, 7);
- State temp = (State)tableLayoutPanel1.GetControlFromPosition(3, 3);
- temp.SetState(State.state.Empty);
- }
- private void timer1_Tick(object sender, EventArgs e)
- {
- //this.BackColor = colorDialog1.Color;
- }
- private void planszaToolStripMenuItem_Click(object sender, EventArgs e)
- {
- if (planszaToolStripMenuItem.Checked)
- {
- planszaToolStripMenuItem.Checked = false;
- empty_img = null;
- occupied_img = null;
- temp_img = null;
- redraw();
- }
- else
- {
- try
- {
- empty_img = new Bitmap("empty.png");
- occupied_img = new Bitmap("occupied.png");
- temp_img = new Bitmap("temp.png");
- planszaToolStripMenuItem.Checked = true;
- redraw();
- }
- catch (ArgumentException e1)
- {
- MessageBox.Show("Nie znaleziono plików! \nWskaż katalog z plikami: \"occupied.png\", \"empty.png\" oraz \"temp.png\".");
- FolderBrowserDialog dir = new FolderBrowserDialog();
- dir.ShowDialog();
- string cat = dir.SelectedPath;
- try
- {
- empty_img = new Bitmap(cat + "/empty.png");
- occupied_img = new Bitmap(cat + "/occupied.png");
- temp_img = new Bitmap(cat + "/temp.png");
- planszaToolStripMenuItem.Checked = true;
- redraw();
- }
- catch (ArgumentException)
- {
- MessageBox.Show("Błąd!");
- empty_img = null;
- occupied_img = null;
- temp_img = null;
- }
- }
- }
- }
- void redraw()
- {
- this.BackColor = backcolor;
- for (int i = 0; i < tableLayoutPanel1.ColumnCount; i++)
- {
- for (int j = 0; j < tableLayoutPanel1.RowCount; j++)
- {
- if ((i == 0 || i == 1 || i == 5 || i == 6) && (j == 0 || j == 1 || j == 5 || j == 6))
- {
- State status1 = (State)tableLayoutPanel1.GetControlFromPosition(i, j);
- status1.SetState(status1.GetState());
- continue;
- }
- else
- {
- State status = (State)tableLayoutPanel1.GetControlFromPosition(i, j);
- status.SetState(status.GetState());
- }
- }
- }
- }
- private void KoloryToolStripMenuItem_Click(object sender, EventArgs e)
- {
- Form2 kolor = new Form2(this);
- kolor.Show();
- }
- private void cofnijToolStripMenuItem_Click(object sender, EventArgs e)
- {
- string move = moves.Substring(moves.Length - 4);
- State f1 = (State)tableLayoutPanel1.GetControlFromPosition(int.Parse(move[0].ToString()), int.Parse(move[1].ToString()));
- f1.SetState(State.state.Occupied);
- State f2 = (State)tableLayoutPanel1.GetControlFromPosition(int.Parse(move[2].ToString()), int.Parse(move[3].ToString()));
- f2.SetState(State.state.Empty);
- if (move[0] == move[2])
- {
- State f3 = (State)tableLayoutPanel1.GetControlFromPosition(int.Parse(move[2].ToString()), ( int.Parse(move[3].ToString()) + int.Parse(move[1].ToString()) )/2 );
- f3.SetState(State.state.Occupied);
- }
- else
- {
- State f3 = (State)tableLayoutPanel1.GetControlFromPosition( ((int.Parse(move[0].ToString()) + int.Parse(move[2].ToString())) / 2), int.Parse(move[3].ToString()));
- f3.SetState(State.state.Occupied);
- }
- moves = moves.Remove(moves.Length - 4);
- if (moves.Length == 0) cofnijToolStripMenuItem.Enabled = false;
- }
- }
- class State : Control
- {
- private state status;
- private PictureBox picture;
- public State(state s, Size size)
- {
- this.Size = size;
- status = s;
- picture = new PictureBox();
- picture.SizeMode = PictureBoxSizeMode.StretchImage;
- picture.Size = size;
- picture.Parent = this;
- SetState(s);
- }
- public enum state { Unavaliable = 0, Empty = 1, Occupied = 2, Temp = 3 }
- public void SetState(state s)
- {
- status = s;
- if (s == state.Unavaliable)
- picture.Image = null;
- else if (s == state.Occupied)
- {
- picture.Image = Form1.occupied_img;
- if (picture.Image == null)
- picture.BackColor = Form1.occupied_col;
- else if (Form1.picBack)
- picture.BackColor = Form1.occupied_col;
- else picture.BackColor = Color.Transparent;
- }
- else if (s == state.Empty)
- {
- picture.Image = Form1.empty_img;
- if (picture.Image == null)
- picture.BackColor = Form1.empty_col;
- else if (Form1.picBack)
- picture.BackColor = Form1.empty_col;
- else
- picture.BackColor = Color.Transparent;
- }
- else
- {
- picture.Image = Form1.temp_img;
- if (picture.Image == null)
- picture.BackColor = Form1.temp_col;
- else if (Form1.picBack)
- picture.BackColor = Form1.temp_col;
- else picture.BackColor = Color.Transparent;
- }
- }
- public state GetState()
- {
- return status;
- }
- public void AddClickHandler(EventHandler e)
- {
- picture.Click += e;
- }
- public void RemoveHandler(EventHandler e)
- {
- picture.Click -= e;
- }
- }
- }
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- ///FORM2.cs
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace PegSolitaire
- {
- public partial class Form2 : Form
- {
- Form1 Parent1;
- public Form2(Form1 parent)
- {
- InitializeComponent();
- button1.BackColor = Form1.empty_col;
- button2.BackColor = Form1.occupied_col;
- button3.BackColor = Form1.temp_col;
- button4.BackColor = Form1.backcolor;
- colorDialog1.Color = button1.BackColor;
- colorDialog2.Color = button2.BackColor;
- colorDialog3.Color = button3.BackColor;
- colorDialog4.Color = button4.BackColor;
- Parent1 = parent;
- }
- private void button5_Click(object sender, EventArgs e)
- {
- Form1 p = (Form1)Parent1;
- p.button5_Click(sender, e);
- }
- private void checkBox1_CheckedChanged(object sender, EventArgs e)
- {
- if (checkBox1.Checked)
- Form1.picBack = true;
- else Form1.picBack = false;
- }
- private void button1_Click(object sender, EventArgs e)
- {
- colorDialog1.ShowDialog();
- button1.BackColor = colorDialog1.Color;
- Form1.empty_col = colorDialog1.Color;
- }
- private void button2_Click(object sender, EventArgs e)
- {
- colorDialog2.ShowDialog();
- button2.BackColor = colorDialog2.Color;
- Form1.occupied_col = colorDialog2.Color;
- }
- private void button3_Click(object sender, EventArgs e)
- {
- colorDialog3.ShowDialog();
- button3.BackColor = colorDialog3.Color;
- Form1.temp_col = colorDialog3.Color;
- }
- private void button4_Click(object sender, EventArgs e)
- {
- colorDialog4.ShowDialog();
- button4.BackColor = colorDialog4.Color;
- Form1.backcolor = colorDialog4.Color;
- }
- private void button5_Click_1(object sender, EventArgs e)
- {
- this.Close();
- }
- private void button7_Click(object sender, EventArgs e)
- {
- Form1.empty_col = Color.Black;
- Form1.occupied_col = Color.BlueViolet;
- Form1.temp_col = Color.DarkGray;
- Form1.backcolor = Color.DodgerBlue;
- button1.BackColor = Form1.empty_col;
- button2.BackColor = Form1.occupied_col;
- button3.BackColor = Form1.temp_col;
- button4.BackColor = Form1.backcolor;
- colorDialog1.Color = button1.BackColor;
- colorDialog2.Color = button2.BackColor;
- colorDialog3.Color = button3.BackColor;
- colorDialog4.Color = button4.BackColor;
- }
- }
- }
- /////////////////////////////////////////////////////////////////////////////////////////////////////////
- ///Form1.Designer.cs
- /////////////////////////////////////////////////////////////////////////////////////////////////////////
- namespace PegSolitaire
- {
- partial class Form1
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
- #region Windows Form Designer generated code
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.menuStrip1 = new System.Windows.Forms.MenuStrip();
- this.plikToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.ustawieniaToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.KoloryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.planszaToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.cofnijToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.pictureBox1 = new System.Windows.Forms.PictureBox();
- this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
- this.menuStrip1.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
- this.tableLayoutPanel1.SuspendLayout();
- this.SuspendLayout();
- //
- // menuStrip1
- //
- this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.plikToolStripMenuItem,
- this.ustawieniaToolStripMenuItem,
- this.cofnijToolStripMenuItem});
- this.menuStrip1.Location = new System.Drawing.Point(0, 0);
- this.menuStrip1.Name = "menuStrip1";
- this.menuStrip1.Size = new System.Drawing.Size(709, 24);
- this.menuStrip1.TabIndex = 1;
- this.menuStrip1.Text = "menuStrip1";
- //
- // plikToolStripMenuItem
- //
- this.plikToolStripMenuItem.Name = "plikToolStripMenuItem";
- this.plikToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));
- this.plikToolStripMenuItem.Size = new System.Drawing.Size(70, 20);
- this.plikToolStripMenuItem.Text = "&Nowa gra";
- this.plikToolStripMenuItem.Click += new System.EventHandler(this.plikToolStripMenuItem_Click);
- //
- // ustawieniaToolStripMenuItem
- //
- this.ustawieniaToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.KoloryToolStripMenuItem,
- this.planszaToolStripMenuItem});
- this.ustawieniaToolStripMenuItem.Name = "ustawieniaToolStripMenuItem";
- this.ustawieniaToolStripMenuItem.Size = new System.Drawing.Size(76, 20);
- this.ustawieniaToolStripMenuItem.Text = "Ustawienia";
- //
- // KoloryToolStripMenuItem
- //
- this.KoloryToolStripMenuItem.Name = "KoloryToolStripMenuItem";
- this.KoloryToolStripMenuItem.Size = new System.Drawing.Size(111, 22);
- this.KoloryToolStripMenuItem.Text = "Kolory";
- this.KoloryToolStripMenuItem.Click += new System.EventHandler(this.KoloryToolStripMenuItem_Click);
- //
- // planszaToolStripMenuItem
- //
- this.planszaToolStripMenuItem.Name = "planszaToolStripMenuItem";
- this.planszaToolStripMenuItem.Size = new System.Drawing.Size(111, 22);
- this.planszaToolStripMenuItem.Text = "Grafika";
- this.planszaToolStripMenuItem.Click += new System.EventHandler(this.planszaToolStripMenuItem_Click);
- //
- // cofnijToolStripMenuItem
- //
- this.cofnijToolStripMenuItem.Enabled = false;
- this.cofnijToolStripMenuItem.Name = "cofnijToolStripMenuItem";
- this.cofnijToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z)));
- this.cofnijToolStripMenuItem.Size = new System.Drawing.Size(51, 20);
- this.cofnijToolStripMenuItem.Text = "Cofnij";
- this.cofnijToolStripMenuItem.Click += new System.EventHandler(this.cofnijToolStripMenuItem_Click);
- //
- // pictureBox1
- //
- this.pictureBox1.Location = new System.Drawing.Point(3, 3);
- this.pictureBox1.Name = "pictureBox1";
- this.pictureBox1.Size = new System.Drawing.Size(16, 12);
- this.pictureBox1.TabIndex = 0;
- this.pictureBox1.TabStop = false;
- //
- // tableLayoutPanel1
- //
- this.tableLayoutPanel1.ColumnCount = 7;
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 14.28571F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 14.28572F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 14.28572F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 14.28572F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 14.28572F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 14.28572F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 14.28571F));
- this.tableLayoutPanel1.Controls.Add(this.pictureBox1, 0, 0);
- this.tableLayoutPanel1.Location = new System.Drawing.Point(12, 27);
- this.tableLayoutPanel1.Name = "tableLayoutPanel1";
- this.tableLayoutPanel1.RowCount = 7;
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28571F));
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28571F));
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28571F));
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28571F));
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28571F));
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28571F));
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28571F));
- this.tableLayoutPanel1.Size = new System.Drawing.Size(161, 132);
- this.tableLayoutPanel1.TabIndex = 2;
- //
- // Form1
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.AutoSize = true;
- this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
- this.ClientSize = new System.Drawing.Size(709, 637);
- this.Controls.Add(this.tableLayoutPanel1);
- this.Controls.Add(this.menuStrip1);
- this.MainMenuStrip = this.menuStrip1;
- this.Name = "Form1";
- this.Text = "Form1";
- this.menuStrip1.ResumeLayout(false);
- this.menuStrip1.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
- this.tableLayoutPanel1.ResumeLayout(false);
- this.ResumeLayout(false);
- this.PerformLayout();
- }
- #endregion
- private System.Windows.Forms.MenuStrip menuStrip1;
- private System.Windows.Forms.ToolStripMenuItem plikToolStripMenuItem;
- private System.Windows.Forms.ToolStripMenuItem ustawieniaToolStripMenuItem;
- private System.Windows.Forms.ToolStripMenuItem KoloryToolStripMenuItem;
- private System.Windows.Forms.ToolStripMenuItem planszaToolStripMenuItem;
- private System.Windows.Forms.PictureBox pictureBox1;
- public System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
- private System.Windows.Forms.ToolStripMenuItem cofnijToolStripMenuItem;
- }
- }
- /////////////////////////////////////////////////////////////////////////////////////////
- ///Form2.Designer.cs
- /////////////////////////////////////////////////////////////////////////////////////////
- namespace PegSolitaire
- {
- partial class Form2
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
- #region Windows Form Designer generated code
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.checkBox1 = new System.Windows.Forms.CheckBox();
- this.label1 = new System.Windows.Forms.Label();
- this.label2 = new System.Windows.Forms.Label();
- this.label3 = new System.Windows.Forms.Label();
- this.button1 = new System.Windows.Forms.Button();
- this.button2 = new System.Windows.Forms.Button();
- this.button3 = new System.Windows.Forms.Button();
- this.label4 = new System.Windows.Forms.Label();
- this.button4 = new System.Windows.Forms.Button();
- this.button5 = new System.Windows.Forms.Button();
- this.colorDialog1 = new System.Windows.Forms.ColorDialog();
- this.colorDialog2 = new System.Windows.Forms.ColorDialog();
- this.colorDialog3 = new System.Windows.Forms.ColorDialog();
- this.colorDialog4 = new System.Windows.Forms.ColorDialog();
- this.button6 = new System.Windows.Forms.Button();
- this.button7 = new System.Windows.Forms.Button();
- this.SuspendLayout();
- //
- // checkBox1
- //
- this.checkBox1.AutoSize = true;
- this.checkBox1.Location = new System.Drawing.Point(29, 189);
- this.checkBox1.Name = "checkBox1";
- this.checkBox1.Size = new System.Drawing.Size(160, 17);
- this.checkBox1.TabIndex = 0;
- this.checkBox1.Text = "Kolory jako tło pod grafikami";
- this.checkBox1.UseVisualStyleBackColor = true;
- this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(97, 33);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(98, 13);
- this.label1.TabIndex = 1;
- this.label1.Text = "Kolor pustego pola:";
- //
- // label2
- //
- this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(95, 69);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(100, 13);
- this.label2.TabIndex = 1;
- this.label2.Text = "Kolor zajętego pola:";
- //
- // label3
- //
- this.label3.AutoSize = true;
- this.label3.Location = new System.Drawing.Point(26, 105);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(169, 13);
- this.label3.TabIndex = 1;
- this.label3.Text = "Kolor pola z podniesionym pionem:";
- //
- // button1
- //
- this.button1.Location = new System.Drawing.Point(201, 28);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(63, 23);
- this.button1.TabIndex = 2;
- this.button1.UseVisualStyleBackColor = true;
- this.button1.Click += new System.EventHandler(this.button1_Click);
- //
- // button2
- //
- this.button2.Location = new System.Drawing.Point(201, 64);
- this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(63, 23);
- this.button2.TabIndex = 2;
- this.button2.UseVisualStyleBackColor = true;
- this.button2.Click += new System.EventHandler(this.button2_Click);
- //
- // button3
- //
- this.button3.Location = new System.Drawing.Point(201, 100);
- this.button3.Name = "button3";
- this.button3.Size = new System.Drawing.Size(63, 23);
- this.button3.TabIndex = 2;
- this.button3.UseVisualStyleBackColor = true;
- this.button3.Click += new System.EventHandler(this.button3_Click);
- //
- // label4
- //
- this.label4.AutoSize = true;
- this.label4.Location = new System.Drawing.Point(145, 139);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(50, 13);
- this.label4.TabIndex = 1;
- this.label4.Text = "Kolor tła:";
- //
- // button4
- //
- this.button4.Location = new System.Drawing.Point(201, 134);
- this.button4.Name = "button4";
- this.button4.Size = new System.Drawing.Size(63, 23);
- this.button4.TabIndex = 2;
- this.button4.UseVisualStyleBackColor = true;
- this.button4.Click += new System.EventHandler(this.button4_Click);
- //
- // button5
- //
- this.button5.Location = new System.Drawing.Point(185, 298);
- this.button5.Name = "button5";
- this.button5.Size = new System.Drawing.Size(79, 31);
- this.button5.TabIndex = 3;
- this.button5.Text = "Zamknij";
- this.button5.UseVisualStyleBackColor = true;
- this.button5.Click += new System.EventHandler(this.button5_Click_1);
- //
- // colorDialog1
- //
- this.colorDialog1.AnyColor = true;
- //
- // colorDialog2
- //
- this.colorDialog2.AnyColor = true;
- //
- // colorDialog3
- //
- this.colorDialog3.AnyColor = true;
- //
- // colorDialog4
- //
- this.colorDialog4.AnyColor = true;
- //
- // button6
- //
- this.button6.Location = new System.Drawing.Point(29, 298);
- this.button6.Name = "button6";
- this.button6.Size = new System.Drawing.Size(79, 31);
- this.button6.TabIndex = 3;
- this.button6.Text = "Zastosuj";
- this.button6.UseVisualStyleBackColor = true;
- this.button6.Click += new System.EventHandler(this.button5_Click);
- //
- // button7
- //
- this.button7.Location = new System.Drawing.Point(185, 234);
- this.button7.Name = "button7";
- this.button7.Size = new System.Drawing.Size(79, 45);
- this.button7.TabIndex = 3;
- this.button7.Text = "Przywróć domyślne";
- this.button7.UseVisualStyleBackColor = true;
- this.button7.Click += new System.EventHandler(this.button7_Click);
- //
- // Form2
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(276, 352);
- this.Controls.Add(this.button6);
- this.Controls.Add(this.button7);
- this.Controls.Add(this.button5);
- this.Controls.Add(this.button4);
- this.Controls.Add(this.button3);
- this.Controls.Add(this.button2);
- this.Controls.Add(this.label4);
- this.Controls.Add(this.button1);
- this.Controls.Add(this.label3);
- this.Controls.Add(this.label2);
- this.Controls.Add(this.label1);
- this.Controls.Add(this.checkBox1);
- this.Name = "Form2";
- this.Text = "Form2";
- this.ResumeLayout(false);
- this.PerformLayout();
- }
- #endregion
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.Label label3;
- private System.Windows.Forms.Button button1;
- private System.Windows.Forms.Button button2;
- private System.Windows.Forms.Button button3;
- private System.Windows.Forms.Label label4;
- private System.Windows.Forms.Button button4;
- private System.Windows.Forms.Button button5;
- public System.Windows.Forms.CheckBox checkBox1;
- private System.Windows.Forms.ColorDialog colorDialog1;
- private System.Windows.Forms.ColorDialog colorDialog2;
- private System.Windows.Forms.ColorDialog colorDialog3;
- private System.Windows.Forms.ColorDialog colorDialog4;
- private System.Windows.Forms.Button button6;
- private System.Windows.Forms.Button button7;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement