示例#1
0
        void ViewStyleMenuItemClick(object sender, EventArgs e)
        {
            EnumToolStripMenuItem item = sender as EnumToolStripMenuItem;

            if (item != null && item.Value is VisualStyleType)
            {
                ChangeViewStyleTo((VisualStyleType)item.Value);
            }
        }
示例#2
0
        // pass a view style you want, the gs view will update to it
        public void ChangeViewStyleTo(VisualStyleType vs)
        {
            VisualStyle oldVs = mPreviewCtrl.mpView.VisualStyle;

            mPreviewCtrl.mpView.VisualStyle = new VisualStyle(vs);
            if (oldVs != null)
            {
                oldVs.Dispose();
            }
            EnumToolStripMenuItem.UpdateCheckedState(viewStyleToolStripMenuItem.DropDown.Items, vs);
            refreshView();
        }
示例#3
0
 void InitializeViewStyleMenuItems()
 {
     viewStyleToolStripMenuItem.DropDown.Items.AddRange(
         EnumToolStripMenuItem.CreateItems <VisualStyleType>(ViewStyleMenuItemClick));
 }