コード例 #1
0
        private void ImplementUserControl()
        {
            PictureBox pictureBox = new PictureBox();
            pictureBox.Image = global::DSA_Teaser.Properties.Resources.DAQ_Icon;
            pictureBox.Location = new System.Drawing.Point(65, 67);
            pictureBox.Name = "pictureBox1";
            pictureBox.Size = new System.Drawing.Size(43, 43);
            pictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
            pictureBox.TabIndex = 0;
            pictureBox.TabStop = false;
            pictureBox.Padding = new Padding(3);
            controlHandle = pictureBox;

            InitControl(controlHandle);

            //Label for the sequence icon
            TextBox textboxSequence = new TextBox();
            textboxSequence.Multiline = true;
            textboxSequence.Size = new System.Drawing.Size(103, 14);
            textboxSequence.Location = new System.Drawing.Point(35, 110);
            textboxSequence.Text = controlName;
            textboxSequence.TextAlign = HorizontalAlignment.Center;
            textboxSequence.BorderStyle = BorderStyle.None;
            textboxSequence.ReadOnly = true;
            textboxSequence.BackColor = System.Drawing.Color.White;
            sequenceTextbox = textboxSequence;

            UserControlSignalGenerator UCSignalGenerator = new UserControlSignalGenerator();
            List<Control> UCList = new List<Control>();
            UCList.Add(UCSignalGenerator);
            objectUserControl = UCList;

            FormDeviceSelector fDAQSelector = new FormDeviceSelector();
            formDAQSelector = fDAQSelector;
            formDAQSelector.textEditDataBuffer.Text = "200";

            formDAQSelector.FormClosing += new FormClosingEventHandler(formDAQSelector_FormClosing);
            formDAQSelector.Show();
        }
コード例 #2
0
        protected override void Control_DoubleClick(object sender, EventArgs e)
        {
            FormDeviceSelector fDAQSelector = new FormDeviceSelector();
            formDAQSelector = fDAQSelector;
            formDAQSelector.textEditDataBuffer.Text = dataBuffer.ToString();

            formDAQSelector.FormClosing += new FormClosingEventHandler(formDAQSelector_FormClosing);
            formDAQSelector.Show();
        }