用新的滚动条替换控件的滚动条

时间:2014-11-13 14:13:44

标签: c# winforms combobox textbox scrollbar

通过MetroFramework library,我现在在我的工具箱中有一个新的scrollbar控件,它继承自Control类并具有以下代码。如何在我当前的控件中替换它,例如combobox或多线textbox

public class MetroScrollBar : Control, IMetroControl
{
    public MetroScrollBar();
    public MetroScrollBar(MetroScrollOrientation orientation);
    public MetroScrollBar(MetroScrollOrientation orientation, int width);

    [Category("Metro Appearance")]
    [DefaultValue(false)]
    public bool HighlightOnWheel { get; set; }
    [DefaultValue(5)]
    public int LargeChange { get; set; }
    public int Maximum { get; set; }
    public int Minimum { get; set; }
    public int MouseWheelBarPartitions { get; set; }
    public MetroScrollOrientation Orientation { get; set; }
    [Category("Metro Appearance")]
    public int ScrollbarSize { get; set; }
    [DefaultValue(1)]
    public int SmallChange { get; set; }
    [Category("Metro Appearance")]
    public MetroColorStyle Style { get; set; }
    [Browsable(false)]
    [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
    public MetroStyleManager StyleManager { get; set; }
    [Category("Metro Appearance")]
    public MetroThemeStyle Theme { get; set; }
    [Category("Metro Appearance")]
    [DefaultValue(false)]
    public bool UseBarColor { get; set; }
    [Category("Metro Appearance")]
    [DefaultValue(false)]
    public bool UseCustomBackColor { get; set; }
    [Browsable(false)]
    [Category("Metro Appearance")]
    [DefaultValue(false)]
    [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
    public bool UseCustomForeColor { get; set; }
    [Browsable(false)]
    [Category("Metro Behaviour")]
    [DefaultValue(false)]
    public bool UseSelectable { get; set; }
    [Browsable(false)]
    [Category("Metro Appearance")]
    [DefaultValue(false)]
    [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
    public bool UseStyleColors { get; set; }
    [Browsable(false)]
    [DefaultValue(0)]
    public int Value { get; set; }

    [Category("Metro Appearance")]
    public event EventHandler<MetroPaintEventArgs> CustomPaint;
    [Category("Metro Appearance")]
    public event EventHandler<MetroPaintEventArgs> CustomPaintBackground;
    [Category("Metro Appearance")]
    public event EventHandler<MetroPaintEventArgs> CustomPaintForeground;
    public event ScrollEventHandler Scroll;

    [SecuritySafeCritical]
    public void BeginUpdate();
    [SecuritySafeCritical]
    public void EndUpdate();
    public bool HitTest(Point point);
    protected virtual void OnCustomPaint(MetroPaintEventArgs e);
    protected virtual void OnCustomPaintBackground(MetroPaintEventArgs e);
    protected virtual void OnCustomPaintForeground(MetroPaintEventArgs e);
    protected override void OnEnabledChanged(EventArgs e);
    protected override void OnEnter(EventArgs e);
    protected override void OnGotFocus(EventArgs e);
    protected override void OnKeyDown(KeyEventArgs e);
    protected override void OnKeyUp(KeyEventArgs e);
    protected override void OnLeave(EventArgs e);
    protected override void OnLostFocus(EventArgs e);
    protected override void OnMouseDown(MouseEventArgs e);
    protected override void OnMouseEnter(EventArgs e);
    protected override void OnMouseLeave(EventArgs e);
    protected override void OnMouseMove(MouseEventArgs e);
    protected override void OnMouseUp(MouseEventArgs e);
    protected override void OnMouseWheel(MouseEventArgs e);
    protected override void OnPaint(PaintEventArgs e);
    protected override void OnPaintBackground(PaintEventArgs e);
    protected virtual void OnPaintForeground(PaintEventArgs e);
    protected override void OnSizeChanged(EventArgs e);
    protected override bool ProcessDialogKey(Keys keyData);
    protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified);
}

0 个答案:

没有答案