怎样向DEV控件RadioGroup添加项及listbox项的添加删除

 

///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);
}

posted @ 2013-05-31 11:25  之远  阅读(1041)  评论(0编辑  收藏  举报