Пример #1
0
        public UCTextBox(CpcDosCPlusTextBox textBox)
        {
            InitializeComponent();
            objets = new CpcDosCPlusListeObjets("fichier1.cpc");
            propertyGrid1.SelectedObject = textBox;
            //TODO: Gérer proprement le binding bi-directionnel
            int TailleX = int.Parse(textBox.SizeX);
            int TailleY = int.Parse(textBox.SizeY);

            textBox1.Text   = textBox.Text;
            textBox1.Width  = TailleX;
            textBox1.Height = TailleY;
            FormCollection nbforms = Application.OpenForms;
            TextBox        montxtbox;

            montxtbox = new TextBox();


            nbforms["preview"].Controls.Add(montxtbox);

            montxtbox.Location  = new Point(int.Parse(textBox.Px), int.Parse(textBox.Py));
            montxtbox.Size      = new Size(TailleX, TailleY);
            montxtbox.Multiline = true;
            montxtbox.Text      = textBox.Text;


            string CouleurFOND;

            CouleurFOND = textBox.BackColor;
            if (CouleurFOND != null)
            {
                textBox5.Text      = textBox.BackColor.Substring(0, 3);
                textBox7.Text      = textBox.BackColor.Substring(4, 3);
                textBox8.Text      = textBox.BackColor.Substring(8, 3);
                textBox1.BackColor = Color.FromArgb(int.Parse(textBox5.Text), int.Parse(textBox7.Text), int.Parse(textBox8.Text));
            }
            else
            {
                textBox1.BackColor = Color.FromArgb(int.Parse(textBox5.Text), int.Parse(textBox7.Text), int.Parse(textBox8.Text));
            }
        }
Пример #2
0
        public UCTextBox(CpcDosCPlusTextBox textBox)
        {
            InitializeComponent();
            objets = new CpcDosCPlusListeObjets("fichier1.cpc");

            //TODO: Gérer proprement le binding bi-directionnel
            TailleX         = int.Parse(textBox.SizeX);
            TailleY         = int.Parse(textBox.SizeY);
            PositionX       = int.Parse(textBox.Px);
            PositionY       = int.Parse(textBox.Py);
            textBox.Text    = textBox.Text;
            textBox3.Width  = TailleX;
            textBox3.Height = TailleY;
            Nom             = textBox.ID;
            Btext           = textBox.Text;
            Bevent          = textBox.Event;
            Bopacite        = textBox.Opacity;
            Bparameters     = textBox.Parameters;


            //on pourra choisir sur quelle forme ajouter en modifiant avec un textbox
            // nbforms["preview"].Controls.Add(monbouton);



            CouleurFOND   = textBox.BackColor;
            CouleurText   = textBox.TextColor;
            textBox1.Text = CouleurFOND;
            // FOND
            if (CouleurFOND == null)
            {
                CouleurFOND = "255,255,255";
            }
            else if (CouleurFOND == "")
            {
                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 if (CouleurText == "")
            {
                CouleurText = "000,000,000";
            }
            else
            {
                redT   = CouleurText.Substring(0, 3);
                greenT = CouleurText.Substring(4, 3);
                blueT  = CouleurText.Substring(8, 3);
            }

            textBox2.Text      = CouleurText;
            textBox3.BackColor = Color.FromArgb(int.Parse(redB), int.Parse(greenB), int.Parse(blueB));



            textBox3.ForeColor = Color.FromArgb(int.Parse(redT), int.Parse(greenT), int.Parse(blueT));
        }