thielj / MetroFramework

Metro UI of Windows 8 for .NET Windows Forms applications
http://thielj.github.io/MetroFramework
Other
396 stars 225 forks source link

No menustrip/toolstrip support #137

Open worstastronomer343 opened 2 years ago

worstastronomer343 commented 2 years ago

Hi,

Among the controls you have listed, there is no MenuStrip or ToolStrip with a Metro UI look and feel.

However, a quick Google search revealed this Stack Overflow page that does give a guide as to how to roll your own:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ModernUISample.metro
{
    /// <summary>
    /// Menustrip for ModernUI-GUIs
    /// </summary>
    public class MetroMenuStrip : System.Windows.Forms.MenuStrip
    {
        /// <summary>
        /// Constructor
        /// </summary>
        public MetroMenuStrip()
            : base()
        {
            Renderer = new MetroToolStripRenderer();
            Font = MetroUI.Style.BaseFont;
            ForeColor = MetroUI.Style.ForeColor;
        }

        /// <summary>
        /// OnItemAdded-Event we adjust the font and forecolor of this item
        /// </summary>
        /// <param name="e"></param>
        protected override void OnItemAdded(System.Windows.Forms.ToolStripItemEventArgs e)
        {
            base.OnItemAdded(e);

            e.Item.Font = MetroUI.Style.BaseFont;
            e.Item.ForeColor = MetroUI.Style.ForeColor;
        }
    }
}

However, the author of this does not place proper using statements in the code, so therefore it is hard to say which framework the author is indeed using.

I suggest adding MetroMenuStrip and MetroToolStrip controls to the library.