コード例 #1
0
        public TimerControl()
        {
            InitializeComponent();
            sounds      = new SoundPlayer[4];
            timerAlerts = new List <int>();
            // prevent flickering
            ControlExtensions.DoubleBuffered(listViewTimer, true);

            // add ButtonAddTimers
            var times = new Dictionary <string, TimeSpan>()
            {
                { "+1 m", new TimeSpan(0, 1, 0) },
                { "+5 m", new TimeSpan(0, 5, 0) },
                { "+20 m", new TimeSpan(0, 20, 0) },
                { "+1 h", new TimeSpan(1, 0, 0) },
                { "+5 h", new TimeSpan(5, 0, 0) },
                { "+1 d", new TimeSpan(24, 0, 0) }
            };

            int i = 0;

            foreach (KeyValuePair <string, TimeSpan> ts in times)
            {
                var bta = new uiControls.ButtonAddTime();
                bta.timeSpan  = ts.Value;
                bta.Text      = "Hi";
                bta.Text      = ts.Key;
                bta.addTimer += buttonAddTime_addTimer;
                bta.Size      = new Size(54, 23);
                bta.Location  = new Point(6 + (i % 3) * 60, 48 + (i / 3) * 29);
                groupBox1.Controls.Add(bta);
                i++;
            }
        }
コード例 #2
0
 public RaisingControl() {
     InitializeComponent();
     listViewBabies.Groups.Add("incubation", "Incubation/Gestation");
     listViewBabies.Groups.Add("baby", "Babies");
     listViewBabies.Groups.Add("growing", "Juveniles / Adolescent");
     updateListView = false;
     ControlExtensions.DoubleBuffered(listViewBabies, true); // prevent flickering
 }