[C#] 个性化下拉列表 →→→→→进入此内容的聊天室

来自 , 2019-05-22, 写在 C#, 查看 108 次.
URL http://www.code666.cn/view/e97c864e
  1. using System;
  2. using System.Drawing;
  3. using System.Windows.Forms;
  4. using TR0217.ControlEx;
  5.  
  6. namespace SplitButton
  7. {
  8.     public partial class Form1 : Form
  9.     {
  10.         ContextContainer _contextContainer = null;
  11.         ContextContainer _contextContainer1 = null;
  12.         public Form1()
  13.         {
  14.             InitializeComponent();
  15.             _contextContainer = new ContextContainer(new UserControl1());
  16.             _contextContainer.ContextMode = ContextMode.MultiSelect;
  17.  
  18.             _contextContainer1 = new ContextContainer(new UserControl2());
  19.             _contextContainer1.ContextMode = ContextMode.MultiSelect;
  20.         }
  21.  
  22.         private void splitButton1_Click(object sender, EventArgs e)
  23.         {
  24.             contextMenuStrip1.Show(splitButton1, new Point(0, splitButton1.Height));
  25.         }
  26.  
  27.         private void splitButton4_SplitMouseClick(object sender, MouseEventArgs e)
  28.         {
  29.             contextMenuStrip2.Show(splitButton4, new Point(0, splitButton4.Height));
  30.         }
  31.  
  32.         private void redToolStripMenuItem_Click(object sender, EventArgs e)
  33.         {
  34.             splitButton1.BackColor = Color.Red;
  35.         }
  36.  
  37.         private void greenToolStripMenuItem_Click(object sender, EventArgs e)
  38.         {
  39.             splitButton1.BackColor = Color.Green;
  40.         }
  41.  
  42.         private void blueToolStripMenuItem_Click(object sender, EventArgs e)
  43.         {
  44.             splitButton1.BackColor = Color.Blue;
  45.         }
  46.  
  47.         private void splitButton5_SplitMouseClick(object sender, MouseEventArgs e)
  48.         {
  49.             _contextContainer.Show(splitButton5);
  50.         }
  51.  
  52.         private void splitButton7_SplitMouseClick(object sender, MouseEventArgs e)
  53.         {
  54.             _contextContainer1.Show(splitButton7);
  55.         }
  56.     }
  57. }
  58.  

回复 "个性化下拉列表"

这儿你可以回复上面这条便签

captcha