Пример #1
0
        private PropertiesToolsWindowsProperty MakePropertyComboBox(string name, string caption, string[] values, string selected)
        {
            PropertiesToolsWindowsProperty propertiesToolsWindowsPart = new PropertiesToolsWindowsProperty(PropertiesToolsWindowsProperty.Type.ComboBox);

            propertiesToolsWindowsPart.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                                      | System.Windows.Forms.AnchorStyles.Right)));
            propertiesToolsWindowsPart.DownControl = null;
            //propertiesToolsWindowsPart.Location = new System.Drawing.Point(10, 5);
            propertiesToolsWindowsPart.Name            = name;
            propertiesToolsWindowsPart.ParentControl   = null;
            propertiesToolsWindowsPart.Size            = new System.Drawing.Size(pPanel.Width, propertiesToolsWindowsPart.Height);
            propertiesToolsWindowsPart.TabIndex        = 1;
            propertiesToolsWindowsPart.PropertyName    = name;
            propertiesToolsWindowsPart.PropertyCaption = caption;
            // fill combobox with values
            propertiesToolsWindowsPart.PropertyListSet(values);
            // select default text
            propertiesToolsWindowsPart.PropertyValue = selected;
            // subscribe to change event
            propertiesToolsWindowsPart.Change += new PropertiesToolsWindowsEventHandler(property_Change);

            if (lastAddedControl != null)
            {
                propertiesToolsWindowsPart.UpControl = (PropertiesToolsWindowsProperty)lastAddedControl;
            }
            this.pPanel.Controls.Add(propertiesToolsWindowsPart);

            lastAddedControl = propertiesToolsWindowsPart;

            return(propertiesToolsWindowsPart);
        }
        private PropertiesToolsWindowsProperty MakePropertyComboBox(string name, string caption, string[] values, string selected)
        {
            PropertiesToolsWindowsProperty propertiesToolsWindowsPart = new PropertiesToolsWindowsProperty(PropertiesToolsWindowsProperty.Type.ComboBox);

            propertiesToolsWindowsPart.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            propertiesToolsWindowsPart.DownControl = null;
            //propertiesToolsWindowsPart.Location = new System.Drawing.Point(10, 5);
            propertiesToolsWindowsPart.Name = name;
            propertiesToolsWindowsPart.ParentControl = null;
            propertiesToolsWindowsPart.Size = new System.Drawing.Size(pPanel.Width, propertiesToolsWindowsPart.Height);
            propertiesToolsWindowsPart.TabIndex = 1;
            propertiesToolsWindowsPart.PropertyName = name;
            propertiesToolsWindowsPart.PropertyCaption = caption;
            // fill combobox with values
            propertiesToolsWindowsPart.PropertyListSet(values);
            // select default text
            propertiesToolsWindowsPart.PropertyValue = selected;
            // subscribe to change event
            propertiesToolsWindowsPart.Change += new PropertiesToolsWindowsEventHandler(property_Change);

            if (lastAddedControl != null)
            {
                propertiesToolsWindowsPart.UpControl = (PropertiesToolsWindowsProperty)lastAddedControl;
            }
            this.pPanel.Controls.Add(propertiesToolsWindowsPart);

            lastAddedControl = propertiesToolsWindowsPart;

            return propertiesToolsWindowsPart;
        }