public override void SetSettings(ToolboxControlSettings form) { // Do main settings base.SetSettings(form); // Do specific settings index = (int)((NumericUpDown)formSlider.allControls[0]).Value; interval = (int)((NumericUpDown)formSlider.allControls[1]).Value; min = (int)((NumericUpDown)formSlider.allControls[2]).Value; max = (int)((NumericUpDown)formSlider.allControls[3]).Value; ifcont = (formSlider.allControls[4].Text.CompareTo(ToolboxControlSettings.btnifcontText_OnCont) == 0); ((TrackBar)control).TickFrequency = interval; ((TrackBar)control).Minimum = min; ((TrackBar)control).Maximum = max; if (ifcont) { control.MouseUp -= SendOnRelease; ((TrackBar)control).ValueChanged += SendOnValueChange; } else { control.MouseUp += SendOnRelease; ((TrackBar)control).ValueChanged -= SendOnValueChange; } }
public GraphicToolbox(Control parentGraphic, FlowLayoutPanel parentToolbox, ContextMenuStrip rightclickMenu) { this.parentGraphic = parentGraphic; this.parentToolbox = parentToolbox; this.rightclickMenu = rightclickMenu; this.rightclickMenu.Items[0].Click += rightclick_RepositionClick; this.rightclickMenu.Items[1].Click += rightclick_SettingsClick; this.rightclickMenu.Items[3].Click += rightclick_DeleteControlClick; this.parentGraphic.MouseClick += ParentGraphic_MouseClick; allControls = new List <KeyValuePair <Control, ToolboxControl> >(); // Create the toolbox items CreateToolbox(); // Create the setting forms formSimpleButton = new ToolboxControlSettings("Settings - Simple Button"); formSimpleButton.CreateSimpleButton(); formOnOffButton = new ToolboxControlSettings("Settings - OnOff Button"); formOnOffButton.CreateOnOffButton(); formSlider = new ToolboxControlSettings("Settings - Slider"); formSlider.CreateSlider(); }
public virtual void SetSettings(ToolboxControlSettings form) { _posx = (int)form.nud_PosX.Value; _posy = (int)form.nud_PosY.Value; _name = form.txtbox_Name.Text; control.Text = _name; control.Location = new Point(_posx, _posy); }
public override void SetSettings(ToolboxControlSettings form) { // Do main settings base.SetSettings(form); // Do specific settings msg_index = (int)((NumericUpDown)form.allControls[0]).Value; msg_value = (int)((NumericUpDown)form.allControls[1]).Value; }
public override void SetSettings(ToolboxControlSettings form) { // Do main settings base.SetSettings(form); // Do specific settings msg1_index = (int)((NumericUpDown)form.allControls[0]).Value; msg1_value = (int)((NumericUpDown)form.allControls[1]).Value; ifdelay = form.allControls[3].Enabled; delayms = (int)((NumericUpDown)form.allControls[3]).Value; msg2_index = (int)((NumericUpDown)form.allControls[4]).Value; msg2_value = (int)((NumericUpDown)form.allControls[5]).Value; if (ifdelay) { control.MouseUp -= SendOnRelease; } else { control.MouseUp += SendOnRelease; } }
protected void UpdateForm(ToolboxControlSettings form) { form.nud_PosX.Value = _posx; form.nud_PosY.Value = _posy; form.txtbox_Name.Text = _name; }