protected override void OnGotFocus(EventArgs e) { vScroll.Invalidate(); base.OnGotFocus(e); //this.Parent.Refresh(); }
/// <summary> /// Sets the current display mode. /// </summary> public virtual void SetDisplayMode(DisplayMode mode) { if (!ClientUtils.IsEnumValid(mode, (int)mode, (int)DisplayMode.Hexdump, (int)DisplayMode.Auto)) { throw new InvalidEnumArgumentException("mode", (int)mode, typeof(DisplayMode)); } _displayMode = mode; _realDisplayMode = (mode == DisplayMode.Auto) ? GetAutoDisplayMode() : mode; switch (_realDisplayMode) { case DisplayMode.Ansi: InitAnsi(); SuspendLayout(); _edit.Show(); _scrollBar.Hide(); ResumeLayout(); Invalidate(); break; case DisplayMode.Unicode: InitUnicode(); SuspendLayout(); _edit.Show(); _scrollBar.Hide(); ResumeLayout(); Invalidate(); break; case DisplayMode.Hexdump: SuspendLayout(); _edit.Hide(); if (_linesCount > _rowCount) { if (!_scrollBar.Visible) { _scrollBar.Show(); ResumeLayout(); _scrollBar.Invalidate(); _scrollBar.Select(); } else { ResumeLayout(); } } else { ResumeLayout(); } break; } }
/// <summary> /// Sets the current display mode. /// </summary> public virtual void SetDisplayMode(DisplayMode mode) { SourceGenerated.EnumValidator.Validate(mode, nameof(mode)); _displayMode = mode; _realDisplayMode = (mode == DisplayMode.Auto) ? GetAutoDisplayMode() : mode; switch (_realDisplayMode) { case DisplayMode.Ansi: InitAnsi(); SuspendLayout(); _edit.Show(); _scrollBar.Hide(); ResumeLayout(); Invalidate(); break; case DisplayMode.Unicode: InitUnicode(); SuspendLayout(); _edit.Show(); _scrollBar.Hide(); ResumeLayout(); Invalidate(); break; case DisplayMode.Hexdump: SuspendLayout(); _edit.Hide(); if (_linesCount > _rowCount) { if (!_scrollBar.Visible) { _scrollBar.Show(); ResumeLayout(); _scrollBar.Invalidate(); _scrollBar.Select(); } else { ResumeLayout(); } } else { ResumeLayout(); } break; } }
private void vsbRightFader_Scroll(object sender, ScrollEventArgs e) { int val = 100 - vsbRightFader.Value; rightLevel = val / 100.0f; project.setRightOutLevel(rightLevel); if (fadersAreLocked) { project.setLeftOutLevel(rightLevel); vsbLeftFader.Value = vsbRightFader.Value; vsbLeftFader.Invalidate(); } }
private bool ScrollToLine(int targetLine) { if (_scrollLine == targetLine) { return(false); } _scrollLine = targetLine; _verticalScrollBar.Value = targetLine; _verticalScrollBar.Enabled = true; _verticalScrollBar.Invalidate(); if (this.UpdateVisibleLines() == true) { this.Invalidate(); } return(true); }
public void SetScrollBarBounds(bool setVertical, bool setHorizontal) { if (setVertical) { VScrollBar.Bounds = new Rectangle(TextArea.Bounds.Right, 0, SystemInformation.HorizontalScrollBarArrowWidth, setHorizontal ? Height - SystemInformation.VerticalScrollBarArrowHeight : Height); VScrollBar.Invalidate(); } if (setHorizontal) { HScrollBar.Bounds = new Rectangle(0, TextArea.Bounds.Bottom, Width - SystemInformation.HorizontalScrollBarArrowWidth, SystemInformation.VerticalScrollBarArrowHeight); HScrollBar.Invalidate(); } }
private bool ScrollToLine(int targetLine) { if (_scrollLine == targetLine) { return(false); } _scrollLine = targetLine; if (_verticalScrollBar.Maximum < _lines.Count) { _verticalScrollBar.Maximum = _lines.Count + 1 - _visibleLines; } _verticalScrollBar.Value = Math.Min(_verticalScrollBar.Maximum, targetLine); if (this.UpdateVisibleLines() == true) { _verticalScrollBar.Invalidate(); this.Invalidate(); } return(true); }
/// <include file='doc\ByteViewer.uex' path='docs/doc[@for="ByteViewer.SetDisplayMode"]/*' /> /// <devdoc> /// <para> /// Sets the current display mode. /// </para> /// </devdoc> public virtual void SetDisplayMode(DisplayMode mode) { if (!Enum.IsDefined(typeof(DisplayMode), mode)) { throw new InvalidEnumArgumentException("mode", (int)mode, typeof(DisplayMode)); } displayMode = mode; realDisplayMode = (mode == DisplayMode.Auto) ? GetAutoDisplayMode() : mode; switch (realDisplayMode) { case DisplayMode.Ansi: InitAnsi(); edit.Show(); scrollBar.Hide(); Invalidate(); break; case DisplayMode.Unicode: InitUnicode(); edit.Show(); scrollBar.Hide(); Invalidate(); break; case DisplayMode.Hexdump: edit.Hide(); if (linesCount > rowCount) { if (!scrollBar.Visible) { scrollBar.Show(); scrollBar.Invalidate(); scrollBar.Select(); } } break; } }
void ResizeControl() { _splitContainer.Size = new Size( Width - _vScrollBar.Width - 1, Height - _hScrollBar.Height - 1); int w = _splitContainer.Panel2.Width; int h = _splitContainer.Panel2.Height; if (w < 0 || w > _matrix.Width) { _hScrollBar.Visible = false; OffsetX = 0; } else { _hScrollBar.Location = new Point(_splitContainer.Panel2.Left, _splitContainer.Height); _hScrollBar.Size = new Size(_splitContainer.Panel2.Width, _hScrollBar.Height); _hScrollBar.Maximum = _matrix.Width; _hScrollBar.LargeChange = Math.Max(_splitContainer.Panel2.Width, 0); _hScrollBar.SmallChange = _displayOptions.CellHeight; // adjust offset so that last scroll does not go past end if (OffsetX + w > _matrix.Width) { OffsetX -= (OffsetX + w - _matrix.Width); } if (OffsetX < 0) { OffsetX = 0; } _hScrollBar.Value = OffsetX; _hScrollBar.Visible = true; } if (h < 0 || h > _matrix.Height) { _vScrollBar.Visible = false; OffsetY = 0; } else { _vScrollBar.Location = new Point(_splitContainer.Width, _displayOptions.RootHeight + 1); _vScrollBar.Size = new Size(_vScrollBar.Width, _splitContainer.Height - _displayOptions.RootHeight); _vScrollBar.Maximum = _matrix.Height - _displayOptions.RootHeight; _vScrollBar.LargeChange = Math.Max(0, _splitContainer.Panel2.Height - _displayOptions.RootHeight); _vScrollBar.SmallChange = _displayOptions.CellHeight; if (OffsetY + h > _matrix.Height) { OffsetY -= (OffsetY + h - _matrix.Height); } if (OffsetY < 0) { OffsetY = 0; } _vScrollBar.Value = OffsetY; _vScrollBar.Visible = true; } _vScrollBar.Invalidate(); _hScrollBar.Invalidate(); }
protected override void OnGotFocus(EventArgs e) { vScroll.Invalidate(); base.OnGotFocus(e); }