public void SetUp()
		{
			m_TextBox = new TextBox();
			m_TextBox.CreateControl();
			m_TextBox.Focus();
			Application.DoEvents();
			m_Handler = new IbusDefaultEventHandler(m_TextBox);
		}
Пример #2
0
        public void TestOneWayBinding()
        {
            IBusinessObject businessObject = new BusinessObject();
            businessObject.Name = "Foo";

            TextBox textbox = new TextBox();
            textbox.CreateControl();
            textbox.BindingContext = new BindingContext();

            using (BindingScope scope = new BindingScope())
            {
                IBusinessObject bindableSource = scope.CreateSource(businessObject);
                TextBox bindableTarget = scope.CreateTarget(textbox);
            }
        }
        public void DisplayParameters(List<UIbaseParam> _parameters)
        {
            SuspendLayout();
            foreach (var pd in m_parametersDesc)
            {
                if (pd.control is SlideCtrl)
                {
                    var slider = pd.control as SlideCtrl;
                    slider.ValueChanged -= Control_ValueChanging;
                    slider.Dispose();
                }
            }
            m_parametersDesc.Clear();
            ResumeLayout();

            int itemY = 0;
            int itemH = 16;
            foreach (var p in _parameters)
            {
                Control control = null;

                if (p is UIFloatParam)
                {
                    var fp = p as UIFloatParam;

                    var slider = new SlideCtrl();
                    slider.Location = new System.Drawing.Point(0, itemY);
                    slider.Height = itemH;
                    slider.SetRange(fp.MinRange, fp.MaxRange, 0.01f);
                    slider.SetPos(fp.Value);
                    slider.Parent = this;
                    slider.Text = p.Name;
                    slider.ValueChanging += Control_ValueChanging;
                    slider.Tag = p;
                    slider.CreateControl();

                    control = slider;
                } else if (p is UITexture2DParam) {

                    var tp = p as UITexture2DParam;

                    var textbox = new TextBox();
                    textbox.Location = new System.Drawing.Point(0, itemY);
                    textbox.Height = itemH;
                    textbox.Parent = this;
                    textbox.Text = tp.Value;
                    textbox.TextChanged += Textbox_TextChanged;
                    textbox.Tag = p;
                    textbox.CreateControl();

                    control = textbox;

                }

                var pd = new ParamDesc();
                pd.param = p;
                pd.control = control;

                itemY += itemH;

            }

        }
Пример #4
0
        private void EditListViewItem(ListViewHitTestInfo item)
        {
            if (item == null || item.SubItem == null)
              {
            return;
              }

              TextBox tbxEdit = new TextBox();
              tbxEdit.Parent = listView1;
              tbxEdit.Tag = item;	// Store clicked item
              tbxEdit.Location = new Point(item.SubItem.Bounds.Location.X, item.SubItem.Bounds.Location.Y - 1);
              tbxEdit.AutoSize = false;
              tbxEdit.Height = item.Item.Bounds.Height + 1;
              tbxEdit.Width = item.SubItem.Bounds.Width + 1;
              tbxEdit.BorderStyle = BorderStyle.FixedSingle;
              tbxEdit.KeyDown += new KeyEventHandler(tbxEdit_KeyDown);
              tbxEdit.LostFocus += new EventHandler(tbxEdit_LostFocus);
              tbxEdit.Text = item.SubItem.Text;
              tbxEdit.CreateControl();
              tbxEdit.Focus();
        }
Пример #5
0
 private void CreateTextBox()
 {
     _textbox = new TextBox();
     _textbox.CreateControl();
     _textbox.Parent = _MControl.Parent;
     _textbox.Width = 0;
     _textbox.Height = 0;
     _textbox.TabStop = true;
     _textbox.KeyDown += new System.Windows.Forms.KeyEventHandler(textBox_KeyDown);
 }
Пример #6
0
 public void Init()
 {
     textBox = new TextBox();
     textBox.Multiline=false;
     textBox.CreateControl();
 }