1个回答
展开全部
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace DevExpress.XtraNavBar.Demos {
/// <summary>
/// Summary description for AddGroups.
/// </summary>
public partial class AddGroups : TutorialControl {
public AddGroups() {
//
// Required for Windows Form Designer support
//
InitializeComponent();
ChangeGroups();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
//<button2>
NavBarGroup LastGroup {
get {
if(navBarControl1.Groups.Count > 0)
return navBarControl1.Groups[navBarControl1.Groups.Count - 1];
return null;
}
}
//</button2>
//<button1>
int i = 0;
private void button1_Click(object sender, System.EventArgs e) {
DevExpress.XtraNavBar.NavBarGroup group = navBarControl1.Groups.Add();
group.Caption = "Group " + (i++).ToString();
ChangeGroups();
}
//</button1>
//<button2>
private void button2_Click(object sender, System.EventArgs e) {
if(LastGroup != null)
LastGroup.Dispose();
ChangeGroups();
}
//</button2>
private void ChangeGroups() {
button2.Enabled = LastGroup != null;
}
}
}
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace DevExpress.XtraNavBar.Demos {
/// <summary>
/// Summary description for AddGroups.
/// </summary>
public partial class AddGroups : TutorialControl {
public AddGroups() {
//
// Required for Windows Form Designer support
//
InitializeComponent();
ChangeGroups();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
//<button2>
NavBarGroup LastGroup {
get {
if(navBarControl1.Groups.Count > 0)
return navBarControl1.Groups[navBarControl1.Groups.Count - 1];
return null;
}
}
//</button2>
//<button1>
int i = 0;
private void button1_Click(object sender, System.EventArgs e) {
DevExpress.XtraNavBar.NavBarGroup group = navBarControl1.Groups.Add();
group.Caption = "Group " + (i++).ToString();
ChangeGroups();
}
//</button1>
//<button2>
private void button2_Click(object sender, System.EventArgs e) {
if(LastGroup != null)
LastGroup.Dispose();
ChangeGroups();
}
//</button2>
private void ChangeGroups() {
button2.Enabled = LastGroup != null;
}
}
}
追问
有图吗?
追答
没。sorry啦,自己好好改改哦,我的只是参考,呵呵...
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询