Наследование: System.Windows.Forms.Control, IMetroControl
Пример #1
1
 public MediaSeekBarControl(MetroTrackBar bar)
 {
     this.bar = bar;
     this.form = bar.FindForm() as MetroAudioForm;
 }
Пример #2
0
        public VolumeControl(MetroTrackBar bar)
        {
            this.bar = bar;
            this.form = bar.FindForm() as MetroAudioForm;

            this.bar.MouseUp += bar_MouseUp;
        }
 public override void Clear()
 {
     base.Clear();
     m_colorBox = null;
     m_alphaTrack = null;
     m_alphaTextBox = null;
     m_preventUpdateEditor = false;
     m_isAlphaValidNumber = false;
 }
        public override void Initialize(PropertiesModel.Property property)
        {
            base.Initialize(property);

            m_colorBox = new Panel();
            m_colorBox.Cursor = Cursors.Hand;
            m_colorBox.Width = 0;
            m_colorBox.Height = 48;
            m_colorBox.Dock = DockStyle.Top;
            m_colorBox.Click += m_colorBox_Click;
            m_colorBox.Paint += m_colorBox_Paint;

            m_alphaTrack = new MetroTrackBar();
            MetroSkinManager.ApplyMetroStyle(m_alphaTrack);
            m_alphaTrack.Width = 0;
            m_alphaTrack.Height = 16;
            m_alphaTrack.Dock = DockStyle.Top;
            m_alphaTrack.Maximum = 255;
            m_alphaTrack.Value = 255;
            m_alphaTrack.ValueChanged += m_alphaTrack_ValueChanged;

            m_alphaTextBox = new MetroTextBox();
            MetroSkinManager.ApplyMetroStyle(m_alphaTextBox);
            m_alphaTextBox.Width = 0;
            m_alphaTextBox.Dock = DockStyle.Top;
            m_alphaTextBox.TextChanged += m_alphaTextBox_TextChanged;
            m_alphaTextBox.CustomPaintForeground += m_alphaTextBox_CustomPaintForeground;
            m_alphaTextBox.Leave += m_alphaTextBox_Leave;

            Content.Controls.Add(m_alphaTrack);
            Content.Controls.Add(m_alphaTextBox);
            Content.Controls.Add(m_colorBox);

            UpdateEditor();
            m_alphaTextBox.Refresh();
        }