Example #1
0
        public frmNumberTracks(int First, int Range)
            : base(Localization.Get(UI_Key.Number_Tracks_Title), ButtonCreateType.OKAndCancel)
        {
            range = Range;

            this.ClientSize     = new System.Drawing.Size(350, 100);
            lblHeading          = new QLabel(Localization.Get(UI_Key.Number_Tracks_Heading));
            lblHeading.Location = new System.Drawing.Point(MARGIN, MARGIN);
            this.Controls.Add(lblHeading);
            lblHeading.SetWidth(this.ClientRectangle.Width - MARGIN - MARGIN);

            int ypos = lblHeading.Bottom + SPACING;

            spnFirst               = new QSpin(false, false, Localization.Get(UI_Key.Number_Tracks_First), String.Empty, 1, 200, 1, 1, this.BackColor);
            spnFirst.Value         = First;
            spnFirst.Location      = new System.Drawing.Point(MARGIN + MARGIN, ypos);
            spnFirst.ValueChanged += valueChanged;
            this.Controls.Add(spnFirst);

            ypos = spnFirst.Bottom + SPACING;

            lblLast          = new QLabel(Localization.Get(UI_Key.Number_Tracks_Last, (First + range - 1).ToString()));
            lblLast.Location = new System.Drawing.Point(MARGIN + MARGIN, ypos);
            lblLast.SetWidth(this.ClientRectangle.Width - MARGIN - MARGIN - MARGIN);
            this.Controls.Add(lblLast);

            ypos = lblLast.Bottom + SPACING;

            PlaceButtons(this.ClientRectangle.Right, ypos);

            this.ClientSize = new System.Drawing.Size(this.ClientSize.Width, btnOK.Bottom + MARGIN);

            spnFirst.Focus();
        }
Example #2
0
 protected override void OnActivated(EventArgs e)
 {
     base.OnActivated(e);
     txtTime.Focus();
 }