public partial class GetLabelFields : Form
{
int tableCount;
public GetLabelFields(AxMapControl axmapcontrol )
{
InitializeComponent();
if(axmapcontrol.LayerCount<=)
{
MessageBox.Show("无图层,请加载图层");
return;
}
ILayer pLayer = axmapcontrol.get_Layer();
IFeatureClass pFeatureClass = ((IFeatureLayer)pLayer).FeatureClass;
ITable pTable = pFeatureClass as ITable;
tableCount = pTable.Fields.FieldCount;
if (tableCount >= )
{
MessageBox.Show("字段过多,不能全部显示");
} for (int i = ; i < tableCount-; i++)
{

Point pPoint = new Point(20,30*(i+1));
RadioButton radioButton = new RadioButton();
radioButton.Size = new System.Drawing.Size(50,20);
radioButton.Location = pPoint;
radioButton.Text = pTable.Fields.get_Field(i + 2).Name;
this.gbxLabelField.Controls.Add(radioButton);


                radioButton.Show();
} }private void btnOK_Click(object sender, EventArgs e)
{
string filename = null;
foreach (GroupBox gbxLabelField in this.Controls.OfType<GroupBox>())
{
foreach (RadioButton radiobutton in gbxLabelField.Controls.OfType<RadioButton>())
{
if (radiobutton.Checked == true)
{
filename = radiobutton.Text;
}
}
}
this.Tag =(object)filename;
this.Close();
} }

form中动态生成Radiobutton控件的更多相关文章

  1. 谨记给UpdatePanel中动态添加的控件赋ID

    原文:谨记给UpdatePanel中动态添加的控件赋ID 昨天下定决 心对上次做的布局编辑器控件加以改进,其中最主要变化的就是要完全使用ASP.NET AJAX!但是很遗憾,虽然耳闻已久,但目前对AS ...

  2. 动态生成PictureBox控件,涉及:PictureBox控件和flowLayoutPanel面板

    一.概述 flowLayoutPanel面板是一系列控件的容器,有关详细的使用方法留待以后总结. 二.问题提出 问题提出:点击按钮,扫描指定文件夹并将其中的所有图片放在flowLayoutPanel面 ...

  3. android中动态修改ImageView控件的宽高度

    本例实现了动态修改ImageView控件的宽高度,有两个按钮,一个按钮实现放大image,一个按钮实现缩小image activity_main.xml <?xml version=" ...

  4. 第二章实例:动态生成View控件例子---小球跟随手指滑动

    package mydefault.packge; import android.app.Activity; import android.content.Context; import androi ...

  5. 通过JavaScript动态生成html控件

    示例代码 <html> <head> <meta http-equiv="Content-Type" content="text/html& ...

  6. Android在onCreate()方法中动态获取TextView控件的高度

    正好朋友项目里遇到了给写了个小Demo: 这个监听器看名字也知道了.就是在绘画完毕之前调用的,在这里面能够获取到行数.当然也能够获取到宽高等信息 package com.example.textvie ...

  7. 如何获取到一个form中的所有子控件?

    使用yield关键字,非常的方便 private static IEnumerable<Control> GetChildren(Control frmRootDock) { if (fr ...

  8. 解决tableView中cell动态加载控件的重用问题

    解决tableView中cell动态加载控件的重用问题 tableView的cell,有时候需要在运行时取得对应的数据后才能够动态的创建该cell中的控件并加载到该cell中,此时,你一定会遇到重用问 ...

  9. WinForm用户控件、动态创建添加控件、timer控件--2016年12月12日

    好文要顶 关注我 收藏该文 徐淳 关注 - 1 粉丝 - 3       0 0     用户控件: 通过布局将多个控件整合为一个控件,根据自己的需要进行修改,可对用户控件内的所有控件及控件属性进行修 ...

随机推荐

  1. Spring MVC 学习总结(六)——Spring+Spring MVC+MyBatis框架集成

    与SSH(Struts/Spring/Hibernate/)一样,Spring+SpringMVC+MyBatis也有一个简称SSM,Spring实现业务对象管理,Spring MVC负责请求的转发和 ...

  2. Deep learning:四十二(Denoise Autoencoder简单理解)

    前言: 当采用无监督的方法分层预训练深度网络的权值时,为了学习到较鲁棒的特征,可以在网络的可视层(即数据的输入层)引入随机噪声,这种方法称为Denoise Autoencoder(简称dAE),由Be ...

  3. Android 2.x中使用actionbar - Actionbarsherlock

    1. 范例说明 从Android 3.0开始,Android引入了ActoinBar,不得不说3.0之前android的标题栏确实比较丑,并且还没有任何功能. 之前很多应用的顶部栏很多都是仿苹果的,比 ...

  4. Windows Azure Traffic Manager (6) 使用Traffic Manager,实现本地应用+云端应用的高可用

    <Windows Azure Platform 系列文章目录> 注意:本文介绍的是使用国内由世纪互联运维的Azure China服务. 以前的Traffic Manager,背后的Serv ...

  5. caffe-window搭建自己的小项目例子

    手头有一个实际的视觉检测的项目,用的是caffe来分类,于是需要用caffe新建自己的项目的例子.在网上找了好久都没有找到合适的,于是自己开始弄. 1 首先是配置caffe的VC++目录中的inclu ...

  6. AndroidStudio 多层级 Module 对 aar 引用问题

    最近碰到这么个恶心的问题 问题:有个arr文件被放到Module A中引用,现在Module B又依赖了Module A,则在编译过程中会发生错误,Module B找不到aar文件.(同时如果又有Mo ...

  7. Git 查看文件的历史

    用惯了tfs,刚一接触git感觉很不顺手,特别是一些很基本的操作,用起来都怪怪的(可能是不习惯命令行的原因吧).下面把查看文件历史的用例小结一下. 查看某个文件的修改历史 在git中查看历史的命令主要 ...

  8. Think different

    Here's to the crazy ones.The misfits.The rebels.The troublemakers.The round pegs in the square holes ...

  9. JAVA - HashMap和HashTable

    1. HashMap 1)  hashmap的数据结构 Hashmap本质就是一个数组,只是当key值重复时,使用链表的方式来存储重复的key值(拉链法),注意:链表中存放的仍然是key值.如下图示: ...

  10. Android 手机上获取物理唯一标识码[转]

    所有添加有谷歌账户的设备可以返回一个 ANDROID_ID 所有的CDMA设备对于 ANDROID_ID 和 TelephonyManager.getDeviceId() 返回相同的值(只要在设置时添 ...