Пример #1
0
 private void InitializeComponent()
 {
     this.paletteTabPage = new TabPage(System.Drawing.Design.SR.GetString("ColorEditorPaletteTab"));
     this.commonTabPage  = new TabPage(System.Drawing.Design.SR.GetString("ColorEditorStandardTab"));
     this.systemTabPage  = new TabPage(System.Drawing.Design.SR.GetString("ColorEditorSystemTab"));
     base.AccessibleName = System.Drawing.Design.SR.GetString("ColorEditorAccName");
     this.tabControl     = new ColorEditorTabControl();
     this.tabControl.TabPages.Add(this.paletteTabPage);
     this.tabControl.TabPages.Add(this.commonTabPage);
     this.tabControl.TabPages.Add(this.systemTabPage);
     this.tabControl.TabStop               = false;
     this.tabControl.SelectedTab           = this.systemTabPage;
     this.tabControl.SelectedIndexChanged += new EventHandler(this.OnTabControlSelChange);
     this.tabControl.Dock         = DockStyle.Fill;
     this.tabControl.Resize      += new EventHandler(this.OnTabControlResize);
     this.lbSystem                = new ColorEditorListBox();
     this.lbSystem.DrawMode       = DrawMode.OwnerDrawFixed;
     this.lbSystem.BorderStyle    = BorderStyle.FixedSingle;
     this.lbSystem.IntegralHeight = false;
     this.lbSystem.Sorted         = false;
     this.lbSystem.Click         += new EventHandler(this.OnListClick);
     this.lbSystem.DrawItem      += new DrawItemEventHandler(this.OnListDrawItem);
     this.lbSystem.KeyDown       += new KeyEventHandler(this.OnListKeyDown);
     this.lbSystem.Dock           = DockStyle.Fill;
     this.lbSystem.FontChanged   += new EventHandler(this.OnFontChanged);
     this.lbCommon                = new ColorEditorListBox();
     this.lbCommon.DrawMode       = DrawMode.OwnerDrawFixed;
     this.lbCommon.BorderStyle    = BorderStyle.FixedSingle;
     this.lbCommon.IntegralHeight = false;
     this.lbCommon.Sorted         = false;
     this.lbCommon.Click         += new EventHandler(this.OnListClick);
     this.lbCommon.DrawItem      += new DrawItemEventHandler(this.OnListDrawItem);
     this.lbCommon.KeyDown       += new KeyEventHandler(this.OnListKeyDown);
     this.lbCommon.Dock           = DockStyle.Fill;
     Array.Sort(this.ColorValues, new ColorEditor.StandardColorComparer());
     Array.Sort(this.SystemColorValues, new ColorEditor.SystemColorComparer());
     this.lbCommon.Items.Clear();
     foreach (object obj2 in this.ColorValues)
     {
         this.lbCommon.Items.Add(obj2);
     }
     this.lbSystem.Items.Clear();
     foreach (object obj3 in this.SystemColorValues)
     {
         this.lbSystem.Items.Add(obj3);
     }
     this.pal         = new ColorEditor.ColorPalette(this, this.CustomColors);
     this.pal.Picked += new EventHandler(this.OnPalettePick);
     this.paletteTabPage.Controls.Add(this.pal);
     this.systemTabPage.Controls.Add(this.lbSystem);
     this.commonTabPage.Controls.Add(this.lbCommon);
     base.Controls.Add(this.tabControl);
 }
 private void InitializeComponent()
 {
     this.paletteTabPage = new TabPage(System.Drawing.Design.SR.GetString("ColorEditorPaletteTab"));
     this.commonTabPage = new TabPage(System.Drawing.Design.SR.GetString("ColorEditorStandardTab"));
     this.systemTabPage = new TabPage(System.Drawing.Design.SR.GetString("ColorEditorSystemTab"));
     base.AccessibleName = System.Drawing.Design.SR.GetString("ColorEditorAccName");
     this.tabControl = new ColorEditorTabControl();
     this.tabControl.TabPages.Add(this.paletteTabPage);
     this.tabControl.TabPages.Add(this.commonTabPage);
     this.tabControl.TabPages.Add(this.systemTabPage);
     this.tabControl.TabStop = false;
     this.tabControl.SelectedTab = this.systemTabPage;
     this.tabControl.SelectedIndexChanged += new EventHandler(this.OnTabControlSelChange);
     this.tabControl.Dock = DockStyle.Fill;
     this.tabControl.Resize += new EventHandler(this.OnTabControlResize);
     this.lbSystem = new ColorEditorListBox();
     this.lbSystem.DrawMode = DrawMode.OwnerDrawFixed;
     this.lbSystem.BorderStyle = BorderStyle.FixedSingle;
     this.lbSystem.IntegralHeight = false;
     this.lbSystem.Sorted = false;
     this.lbSystem.Click += new EventHandler(this.OnListClick);
     this.lbSystem.DrawItem += new DrawItemEventHandler(this.OnListDrawItem);
     this.lbSystem.KeyDown += new KeyEventHandler(this.OnListKeyDown);
     this.lbSystem.Dock = DockStyle.Fill;
     this.lbSystem.FontChanged += new EventHandler(this.OnFontChanged);
     this.lbCommon = new ColorEditorListBox();
     this.lbCommon.DrawMode = DrawMode.OwnerDrawFixed;
     this.lbCommon.BorderStyle = BorderStyle.FixedSingle;
     this.lbCommon.IntegralHeight = false;
     this.lbCommon.Sorted = false;
     this.lbCommon.Click += new EventHandler(this.OnListClick);
     this.lbCommon.DrawItem += new DrawItemEventHandler(this.OnListDrawItem);
     this.lbCommon.KeyDown += new KeyEventHandler(this.OnListKeyDown);
     this.lbCommon.Dock = DockStyle.Fill;
     Array.Sort(this.ColorValues, new ColorEditor.StandardColorComparer());
     Array.Sort(this.SystemColorValues, new ColorEditor.SystemColorComparer());
     this.lbCommon.Items.Clear();
     foreach (object obj2 in this.ColorValues)
     {
         this.lbCommon.Items.Add(obj2);
     }
     this.lbSystem.Items.Clear();
     foreach (object obj3 in this.SystemColorValues)
     {
         this.lbSystem.Items.Add(obj3);
     }
     this.pal = new ColorEditor.ColorPalette(this, this.CustomColors);
     this.pal.Picked += new EventHandler(this.OnPalettePick);
     this.paletteTabPage.Controls.Add(this.pal);
     this.systemTabPage.Controls.Add(this.lbSystem);
     this.commonTabPage.Controls.Add(this.lbCommon);
     base.Controls.Add(this.tabControl);
 }
Пример #3
0
            private void InitializeComponent()
            {
                paletteTabPage = new TabPage(SR.ColorEditorPaletteTab);
                commonTabPage  = new TabPage(SR.ColorEditorStandardTab);
                systemTabPage  = new TabPage(SR.ColorEditorSystemTab);

                AccessibleName = SR.ColorEditorAccName;

                tabControl = new ColorEditorTabControl();
                tabControl.TabPages.Add(paletteTabPage);
                tabControl.TabPages.Add(commonTabPage);
                tabControl.TabPages.Add(systemTabPage);
                tabControl.TabStop               = false;
                tabControl.SelectedTab           = systemTabPage;
                tabControl.SelectedIndexChanged += new EventHandler(OnTabControlSelChange);
                tabControl.Dock    = DockStyle.Fill;
                tabControl.Resize += new EventHandler(OnTabControlResize);

                lbSystem = new ColorEditorListBox
                {
                    DrawMode       = DrawMode.OwnerDrawFixed,
                    BorderStyle    = BorderStyle.FixedSingle,
                    IntegralHeight = false,
                    Sorted         = false
                };
                lbSystem.Click       += new EventHandler(OnListClick);
                lbSystem.DrawItem    += new DrawItemEventHandler(OnListDrawItem);
                lbSystem.KeyDown     += new KeyEventHandler(OnListKeyDown);
                lbSystem.Dock         = DockStyle.Fill;
                lbSystem.FontChanged += new EventHandler(OnFontChanged);

                lbCommon = new ColorEditorListBox
                {
                    DrawMode       = DrawMode.OwnerDrawFixed,
                    BorderStyle    = BorderStyle.FixedSingle,
                    IntegralHeight = false,
                    Sorted         = false
                };
                lbCommon.Click    += new EventHandler(OnListClick);
                lbCommon.DrawItem += new DrawItemEventHandler(OnListDrawItem);
                lbCommon.KeyDown  += new KeyEventHandler(OnListKeyDown);
                lbCommon.Dock      = DockStyle.Fill;

                Array.Sort(ColorValues, new StandardColorComparer());
                Array.Sort(SystemColorValues, new SystemColorComparer());

                lbCommon.Items.Clear();
                foreach (object color in ColorValues)
                {
                    lbCommon.Items.Add(color);
                }

                lbSystem.Items.Clear();
                foreach (object color in SystemColorValues)
                {
                    lbSystem.Items.Add(color);
                }

                pal         = new ColorPalette(this, CustomColors);
                pal.Picked += new EventHandler(OnPalettePick);

                paletteTabPage.Controls.Add(pal);
                systemTabPage.Controls.Add(lbSystem);
                commonTabPage.Controls.Add(lbCommon);

                Controls.Add(tabControl);
            }