using System; |
using System.Drawing; |
using System.Windows.Forms; |
using TR0217.ControlEx; |
namespace SplitButton |
{ |
public partial class Form1 : Form |
{ |
ContextContainer _contextContainer = null ; |
ContextContainer _contextContainer1 = null ; |
public Form1() |
{ |
InitializeComponent(); |
_contextContainer = new ContextContainer( new UserControl1()); |
_contextContainer.ContextMode = ContextMode.MultiSelect; |
_contextContainer1 = new ContextContainer( new UserControl2()); |
_contextContainer1.ContextMode = ContextMode.MultiSelect; |
} |
private void splitButton1_Click( object sender, EventArgs e) |
{ |
contextMenuStrip1.Show(splitButton1, new Point(0, splitButton1.Height)); |
} |
private void splitButton4_SplitMouseClick( object sender, MouseEventArgs e) |
{ |
contextMenuStrip2.Show(splitButton4, new Point(0, splitButton4.Height)); |
} |
private void redToolStripMenuItem_Click( object sender, EventArgs e) |
{ |
splitButton1.BackColor = Color.Red; |
} |
private void greenToolStripMenuItem_Click( object sender, EventArgs e) |
{ |
splitButton1.BackColor = Color.Green; |
} |
private void blueToolStripMenuItem_Click( object sender, EventArgs e) |
{ |
splitButton1.BackColor = Color.Blue; |
} |
private void splitButton5_SplitMouseClick( object sender, MouseEventArgs e) |
{ |
_contextContainer.Show(splitButton5); |
} |
private void splitButton7_SplitMouseClick( object sender, MouseEventArgs e) |
{ |
_contextContainer1.Show(splitButton7); |
} |
} |
} |
by: 发表于:2017-12-08 09:42:26 顶(0) | 踩(0) 回复
??
回复评论