private void Dessiner_Lien_Optimal(Bunifu.UI.WinForms.BunifuPictureBox A, Bunifu.UI.WinForms.BunifuPictureBox B) { Pen MonStylo = new Pen(Color.Yellow, 4); Point PositionRouter1 = new Point(A.Location.X + (A.Size.Width / 2), A.Location.Y + (A.Size.Height / 2)); Point PositionRouter2 = new Point(B.Location.X + (B.Size.Width / 2), B.Location.Y + (B.Size.Height / 2)); Dessin.DrawLine(MonStylo, PositionRouter1, PositionRouter2); }
/*************************************** * CONSTRUCTEUR ***************************************/ public Router() { FaceRouter = new Bunifu.UI.WinForms.BunifuPictureBox(); FaceRouter.SizeMode = PictureBoxSizeMode.Zoom; FaceRouter.Tag = "oneTime"; FaceRouter.Location = Machine.LesPoints[Machine.index]; Machine.index++; FaceRouter.Size = new System.Drawing.Size(largeur, longueur); FaceRouter.ImageLocation = "C:/Users/azizc/Pictures/SoftwareTools7.png"; Machine.ajouter_router(this); }
private void leavingTextBox(MaskedTextBox tbox, Bunifu.UI.WinForms.BunifuPictureBox pbox) { pbox.Visible = true; if (string.Equals(tbox.Text, "")) { //red background tbox.BackColor = Color.FromArgb(251, 195, 195); //warning picture pbox.Image = BookExcerciseSolution.Properties.Resources.wrong1; } else { // green backgroud tbox.BackColor = Color.FromArgb(192, 239, 191); // correct picture pbox.Image = BookExcerciseSolution.Properties.Resources.tick1; } }
public ChoixDesLiaisons() { InitializeComponent(); //RangementDeChoix.Hide(); int i = 0; int stat; while (i < Form1.NombreDeRouter) { stat = 1; //215,100 TableLayoutPanel MyTable = new TableLayoutPanel(); MyTable.Size = new Size(300, 100); MyTable.ColumnCount = 2; MyTable.RowCount = 1; MyTable.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); MyTable.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); MyTable.RowStyles.Add(new RowStyle(SizeType.Absolute, 100F)); MyTable.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single; Bunifu.UI.WinForms.BunifuPictureBox MyPicture = new Bunifu.UI.WinForms.BunifuPictureBox(); MyPicture.Size = new Size(50, 50); MyPicture.Image = Properties.Resources.SoftwareTools7; Label MyLabel = new Label(); MyLabel.Text = "Router" + (i + 1); FlowLayoutPanel MyFlowPanel1 = new FlowLayoutPanel(); MyFlowPanel1.FlowDirection = FlowDirection.TopDown; MyFlowPanel1.AutoScroll = true; MyFlowPanel1.WrapContents = false; MyFlowPanel1.Controls.Add(MyPicture); MyFlowPanel1.Controls.Add(MyLabel); MyTable.Controls.Add(MyFlowPanel1, 0, 0); FlowLayoutPanel MyFlowPanel2 = new FlowLayoutPanel(); MyFlowPanel2.FlowDirection = FlowDirection.TopDown; MyFlowPanel2.AutoScroll = true; MyFlowPanel2.WrapContents = false; while (stat <= Form1.NombreDeRouter) { if ((i + 1) == stat) { stat++; } else { Bunifu.Framework.UI.BunifuCheckbox MyCheckbox = new Bunifu.Framework.UI.BunifuCheckbox(); MyCheckbox.Checked = false; MyCheckbox.Tag = "" + stat; Label MyLabel2 = new Label(); MyLabel2.Text = "Router" + stat; MyFlowPanel2.Controls.Add(MyCheckbox); MyFlowPanel2.Controls.Add(MyLabel2); stat++; } } MyTable.Controls.Add(MyFlowPanel2, 1, 0); LiaisonMainFlow.Controls.Add(MyTable); i++; } }
private void enteringTextBox(MaskedTextBox tbox, Bunifu.UI.WinForms.BunifuPictureBox pbox) { tbox.BackColor = Color.White; pbox.Image = null; }
private void Panel_Liaison_Content() { int i = 0; int stat; while (i < NombreDeRouter) { stat = 1; //215,100 TableLayoutPanel MyTable = new TableLayoutPanel(); MyTable.Size = new Size(1025, 100); MyTable.ColumnCount = 2; MyTable.RowCount = 1; MyTable.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 20F)); MyTable.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 80F)); MyTable.RowStyles.Add(new RowStyle(SizeType.Absolute, 100F)); MyTable.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single; Bunifu.UI.WinForms.BunifuPictureBox MyPicture = new Bunifu.UI.WinForms.BunifuPictureBox(); MyPicture.Size = new Size(50, 50); MyPicture.Image = Properties.Resources.SoftwareTools7; Label MyLabel = new Label(); MyLabel.Text = "Router" + (i + 1); FlowLayoutPanel MyFlowPanel1 = new FlowLayoutPanel(); MyFlowPanel1.FlowDirection = FlowDirection.TopDown; MyFlowPanel1.AutoScroll = true; MyFlowPanel1.WrapContents = false; MyFlowPanel1.Controls.Add(MyPicture); MyFlowPanel1.Controls.Add(MyLabel); MyTable.Controls.Add(MyFlowPanel1, 0, 0); FlowLayoutPanel MyFlowPanel2 = new FlowLayoutPanel(); MyFlowPanel2.FlowDirection = FlowDirection.LeftToRight; MyFlowPanel2.AutoSize = true; MyFlowPanel2.AutoScroll = false; MyFlowPanel2.WrapContents = true; while (stat <= NombreDeRouter) { if ((i + 1) == stat) { stat++; } else { Bunifu.Framework.UI.BunifuCheckbox MyCheckbox = new Bunifu.Framework.UI.BunifuCheckbox(); MyCheckbox.Checked = false; MyCheckbox.Name = "" + stat; MyCheckbox.Tag = "" + i; MyCheckbox.OnChange += MyCheckbox_OnChange; Label MyLabel2 = new Label(); MyLabel2.Text = "Router" + stat; MyFlowPanel2.Controls.Add(MyCheckbox); MyFlowPanel2.Controls.Add(MyLabel2); //CheckBoxList.Add(MyCheckbox); stat++; } } MyTable.Controls.Add(MyFlowPanel2, 1, 0); LiaisonMainFlow.Controls.Add(MyTable); i++; } }