protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); Graphics g = e.Graphics; g.Clear(BackgroundColor); DrawGrid(g); DrawTracks(g); DrawLabels(g); ScrollbarH.Refresh(); ScrollbarV.Refresh(); }
private void RecalculateScrollbarBounds() { if (_tracks.Count == 0) { ScrollbarH.Maximum = 0; ScrollbarV.Maximum = 0; //ScrollbarH.Max = ScrollbarV.Max = 0; } else { ScrollbarV.Maximum = (int)((_tracks.Count * (TrackHigh + TrackSpace)) * _renderingScale.Y); ScrollbarH.Maximum = 100; // TODO (int)(_tracks.Max(t => t.TrackElements.Any() ? t.TrackElements.Max(te => te.End) : 0) * _renderingScale.X); } ScrollbarV.Refresh(); ScrollbarH.Refresh(); }