怎样向DEV控件RadioGroup添加项及listbox项的添加删除
1个回答
推荐于2018-04-12 · 知道合伙人数码行家
可以叫我表哥
知道合伙人数码行家
向TA提问 私信TA
知道合伙人数码行家
采纳数:25897
获赞数:1464977
2010年毕业于北京化工大学北方学院计算机科学与技术专业毕业,学士学位,工程电子技术行业4年从业经验。
向TA提问 私信TA
关注
展开全部
///RadioGroup添加项
public void intit()
{
esriGeoAnalysisSlopeEnum m_SlopeType1 = esriGeoAnalysisSlopeEnum.esriGeoAnalysisSlopeDegrees;
esriGeoAnalysisSlopeEnum m_SlopeType2 = esriGeoAnalysisSlopeEnum.esriGeoAnalysisSlopePercentrise;
DevExpress.XtraEditors.Controls.RadioGroupItem item1 = new DevExpress.XtraEditors.Controls.RadioGroupItem(m_SlopeType1, "坡度");
DevExpress.XtraEditors.Controls.RadioGroupItem item2 = new DevExpress.XtraEditors.Controls.RadioGroupItem(m_SlopeType2, "百分比");
this.radioMethed.Properties.Items.Add(item1);
this.radioMethed.Properties.Items.Add(item2);
}
///listbox项的添加删除
private void AddButton_Click(object sender, EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); //定义打开的默认文件夹位置
ofd.Multiselect = true;
ofd.ShowDialog();
string[] fileNames = ofd.FileNames;
for (int i = 0; i < fileNames.Length; i++)
{
object obj = fileNames[i] as object;
this.listBoxVillage.Items.Add(obj);
}
}
private void DeleteButton_Click(object sender, EventArgs e)
{
this.listBoxVillage.Items.RemoveAt(this.listBoxVillage.SelectedIndex);
}
public void intit()
{
esriGeoAnalysisSlopeEnum m_SlopeType1 = esriGeoAnalysisSlopeEnum.esriGeoAnalysisSlopeDegrees;
esriGeoAnalysisSlopeEnum m_SlopeType2 = esriGeoAnalysisSlopeEnum.esriGeoAnalysisSlopePercentrise;
DevExpress.XtraEditors.Controls.RadioGroupItem item1 = new DevExpress.XtraEditors.Controls.RadioGroupItem(m_SlopeType1, "坡度");
DevExpress.XtraEditors.Controls.RadioGroupItem item2 = new DevExpress.XtraEditors.Controls.RadioGroupItem(m_SlopeType2, "百分比");
this.radioMethed.Properties.Items.Add(item1);
this.radioMethed.Properties.Items.Add(item2);
}
///listbox项的添加删除
private void AddButton_Click(object sender, EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); //定义打开的默认文件夹位置
ofd.Multiselect = true;
ofd.ShowDialog();
string[] fileNames = ofd.FileNames;
for (int i = 0; i < fileNames.Length; i++)
{
object obj = fileNames[i] as object;
this.listBoxVillage.Items.Add(obj);
}
}
private void DeleteButton_Click(object sender, EventArgs e)
{
this.listBoxVillage.Items.RemoveAt(this.listBoxVillage.SelectedIndex);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询