Пример #1
0
 public static Panel getPropertyColorPanel(Color color, EventHandler handler, PropertyTag propertyTag, bool disabled)
 {
     Panel panel = new Panel();
     panel.Name = "pgmtCustomPropertyColorPanel" + ControlHelper.CONTROLCOUNT++;
     panel.Width = 20;
     panel.Height = 20;
     panel.BackColor = color;
     panel.Click += handler;
     panel.Tag = propertyTag;
     panel.Enabled = !disabled;
     return panel;
 }
Пример #2
0
 public static Button getPropertyButton(string text, EventHandler handler, PropertyTag propertyTag, bool disabled)
 {
     Button button = new Button();
     button.Name = "tbCustomButton_" + ControlHelper.CONTROLCOUNT++;
     if ("DEL".Equals(text))
     {
         button.Text = "";
         button.Image = PetriNetworkSimulator.Properties.Resources.exitApplication;
     }
     else
     {
         button.Text = text;
     }
     button.Click += handler;
     button.Tag = propertyTag;
     button.Enabled = !disabled;
     button.Anchor = ((AnchorStyles)((AnchorStyles.Left | AnchorStyles.Right)));
     return button;
 }
Пример #3
0
 public static ComboBox getPropertyEdgeTypeComboBox(EdgeType edgeType, EventHandler handler, PropertyTag propertyTag, bool disabled)
 {
     ComboBox control = new ComboBox();
     control.Name = "tbCustomComboBox_" + ControlHelper.CONTROLCOUNT++;
     foreach (EdgeType item in EdgeType.Values)
     {
         control.Items.Add(item);
     }
     control.SelectedItem = edgeType;
     control.DropDownStyle = ComboBoxStyle.DropDownList;
     control.SelectedValueChanged += handler;
     control.Tag = propertyTag;
     control.Enabled = !disabled;
     control.Anchor = ((AnchorStyles)((AnchorStyles.Left | AnchorStyles.Right)));
     return control;
 }
Пример #4
0
 public static TextBox getPropertyTextBox(string text, EventHandler handler, PropertyTag propertyTag, bool disabled)
 {
     TextBox textbox = new TextBox();
     textbox.Name = "tbCustomTextBox_" + ControlHelper.CONTROLCOUNT++;
     textbox.Text = text;
     textbox.TextChanged += handler;
     textbox.Tag = propertyTag;
     textbox.Enabled = !disabled;
     textbox.Anchor = ((AnchorStyles)((AnchorStyles.Left | AnchorStyles.Right)));
     return textbox;
 }