コード例 #1
0
 string sld_FormatValue(LabelSlider Sender, int Value) {
     ConfigurationEntry entry = (ConfigurationEntry)Sender.Tag;
     return entry.GetValueAsString(GetValueOfControl(Sender));
 }
コード例 #2
0
        LabelSlider AddLabelSliderToRow(ConfigurationEntry Entry, Int32 Row) {
            LabelSlider sld = new LabelSlider();
            ApplyBasicControlSettings(sld, Entry, 1, Row);

            // Layout
            sld.Anchor = AnchorStyles.Right | AnchorStyles.Left;

            // Content
            sld.FormatValue += new LabelSlider.FormatValueEvent(sld_FormatValue);
            sld.Minimum = ConfigurationEntry.ToInt32(Entry.Minimum, 0);
            sld.Maximum = ConfigurationEntry.ToInt32(Entry.Maximum, 10);
            sld.SmallChange = 1;
            sld.LargeChange = Convert.ToInt32(Math.Round((Convert.ToDouble(sld.Maximum - sld.Minimum)) / 10.0));
            sld.Value = ConfigurationEntry.ToInt32(Entry.Value, sld.Minimum);
            sld.ValueChanged += new EventHandler(control_ValueChanged);

            return sld;
        }