经过几轮测试终于能有点结果了,一下是重新创建了一个form
要协助修改后台设计器生成的代码
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.c1RadialMenu1 = new C1.Win.C1Command.C1RadialMenu();
this.radialMenuItem1 = new C1.Win.C1Command.RadialMenuItem();
this.radialMenuItem2 = new C1.Win.C1Command.RadialMenuItem();
this.radialMenuItem3 = new C1.Win.C1Command.RadialMenuItem();
this.radialMenuItem4 = new C1.Win.C1Command.RadialMenuItem();
this.radialMenuItem5 = new C1.Win.C1Command.RadialMenuItem();
this.c1ThemeController1 = new C1.Win.C1Themes.C1ThemeController();
((System.ComponentModel.ISupportInitialize)(this.c1ThemeController1)).BeginInit();
this.SuspendLayout();
//
// c1RadialMenu1
//
this.c1RadialMenu1.AutoHide = false;
this.c1RadialMenu1.BorderWidth = 30;
this.c1RadialMenu1.ButtonRadius = 26;
this.c1RadialMenu1.Image = ((System.Drawing.Image)(resources.GetObject("c1RadialMenu1.Image")));
this.c1RadialMenu1.Items.Add(this.radialMenuItem1);
this.c1RadialMenu1.Items.Add(this.radialMenuItem2);
this.c1RadialMenu1.Items.Add(this.radialMenuItem3);
this.c1RadialMenu1.Items.Add(this.radialMenuItem4);
this.c1RadialMenu1.Items.Add(this.radialMenuItem5);
this.c1RadialMenu1.Radius = 160;
this.c1RadialMenu1.UseAnimation = true;
this.c1ThemeController1.SetTheme(this.c1RadialMenu1, "Office2007Blue");
this.c1RadialMenu1.ItemClick += new C1.Win.C1Command.RadialMenuItemClickEventHandler(this.c1RadialMenu1_ItemClick);
//
// radialMenuItem1
//
this.radialMenuItem1.Name = "radialMenuItem1";
this.radialMenuItem1.Text = "打开";
this.radialMenuItem1.ToolTip = "打开";
//
// radialMenuItem2
//
this.radialMenuItem2.Name = "radialMenuItem2";
this.radialMenuItem2.Text = "新建";
this.radialMenuItem2.ToolTip = "新建";
//
// radialMenuItem3
//
this.radialMenuItem3.Name = "radialMenuItem3";
this.radialMenuItem3.Text = "另存";
this.radialMenuItem3.ToolTip = "另存";
//
// radialMenuItem4
//
this.radialMenuItem4.Name = "radialMenuItem4";
this.radialMenuItem4.Text = "打印";
this.radialMenuItem4.ToolTip = "打印";
//
// radialMenuItem5
//
this.radialMenuItem5.Name = "radialMenuItem5";
this.radialMenuItem5.Text = "预览";
this.radialMenuItem5.ToolTip = "预览";
//
// c1ThemeController1
//
this.c1ThemeController1.Theme = "Office2007Blue";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(659, 366);
this.Name = "Form1";
this.Text = "Form1";
this.MouseClick += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseClick);
((System.ComponentModel.ISupportInitialize)(this.c1ThemeController1)).EndInit();
this.ResumeLayout(false);
}
同时添加了ItemClick事件,把Item的text内容显示出来
private void c1RadialMenu1_ItemClick(object sender, C1.Win.C1Command.RadialMenuItemClickEventArgs e)
{
C1.Win.C1Command.RadialMenuItem rmi = e.RadialMenuItem as C1.Win.C1Command.RadialMenuItem;
if (rmi != null)
{
string str = rmi.Text;
MessageBox.Show(str);
}
}
private void Form1_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == System.Windows.Forms.MouseButtons.Right)
c1RadialMenu1.ShowMenu(this, new Point(600, 500), true);
if (e.Button == System.Windows.Forms.MouseButtons.Left)
c1RadialMenu1.HideMenu();
}
一下是效果图
距离我原来的效果再差一步距离了,望葡萄城的高手赐教了 |