public UCButton(CpcDosCPlusBouton button) { InitializeComponent(); //TODO: Gérer proprement le binding bi-directionnel textBox1.Text = button.Texte; button1.Text = button.Texte; }
public UCButton(CpcDosCPlusBouton button) { InitializeComponent(); objets = new CpcDosCPlusListeObjets("fichier1.cpc"); propertyGrid1.SelectedObject = button; //TODO: Gérer proprement le binding bi-directionnel int TailleX = int.Parse(button.SizeX); int TailleY = int.Parse(button.SizeY); button1.Text = button.Text; button1.Width = TailleX; button1.Height = TailleY; FormCollection nbforms = Application.OpenForms; Button monbouton; monbouton = new Button(); //on pourra choisir sur quelle forme ajouter en modifiant avec un textbox nbforms["preview"].Controls.Add(monbouton); monbouton.Location = new Point(int.Parse(button.Px), int.Parse(button.Py)); monbouton.Size = new Size(TailleX, TailleY); monbouton.Text = button.Text; string CouleurFOND; string red = "255"; string green = "255"; string blue = "255"; CouleurFOND = button.BackColor; textBox1.Text = CouleurFOND; if (CouleurFOND == null) { CouleurFOND = "255,255,255"; } else { red = CouleurFOND.Substring(0, 3); } green = CouleurFOND.Substring(4, 3); blue = CouleurFOND.Substring(8, 3); button1.BackColor = Color.FromArgb(int.Parse(red), int.Parse(green), int.Parse(blue)); monbouton.BackColor = Color.FromArgb(int.Parse(red), int.Parse(green), int.Parse(blue)); }
public UCButton(CpcDosCPlusBouton button) { InitializeComponent(); objets = new CpcDosCPlusListeObjets("fichier1.cpc"); //TODO: Gérer proprement le binding bi-directionnel TailleX = int.Parse(button.SizeX); TailleY = int.Parse(button.SizeY); PositionX = int.Parse(button.Px); PositionY = int.Parse(button.Py); button1.Text = button.Text; button1.Width = TailleX; button1.Height = TailleY; Nom = button.ID; Btext = button.Text; Bevent = button.Event; Bopacite = button.Opacity; Bparameters = button.Parameters; FormCollection nbforms = Application.OpenForms; Button monbouton; monbouton = new Button(); //on pourra choisir sur quelle forme ajouter en modifiant avec un textbox // nbforms["preview"].Controls.Add(monbouton); monbouton.Location = new Point(int.Parse(button.Px), int.Parse(button.Py)); monbouton.Size = new Size(TailleX, TailleY); monbouton.Text = button.Text; CouleurFOND = button.BackColor; CouleurText = button.TextColor; textBox1.Text = CouleurFOND; // FOND if (CouleurFOND == null) { CouleurFOND = "255,255,255"; } else { redB = CouleurFOND.Substring(0, 3); greenB = CouleurFOND.Substring(4, 3); blueB = CouleurFOND.Substring(8, 3); } //TEXT if (CouleurText == null) { CouleurText = "000,000,000"; } else { redT = CouleurText.Substring(0, 3); greenT = CouleurText.Substring(4, 3); blueT = CouleurText.Substring(8, 3); } textBox2.Text = CouleurText; button1.BackColor = Color.FromArgb(int.Parse(redB), int.Parse(greenB), int.Parse(blueB)); monbouton.BackColor = Color.FromArgb(int.Parse(redB), int.Parse(greenB), int.Parse(blueB)); button1.ForeColor = Color.FromArgb(int.Parse(redT), int.Parse(greenT), int.Parse(blueT)); monbouton.ForeColor = Color.FromArgb(int.Parse(redT), int.Parse(greenT), int.Parse(blueT)); }