Exemplo n.º 1
0
        /// <summary>
        /// 生成控件名:当前名称最大值+1
        /// </summary>
        /// <param name="container"></param>
        /// <param name="dataType"></param>
        /// <returns></returns>
        public string CreateName(System.ComponentModel.IContainer container, System.Type dataType)
        {
            int    i    = 0;
            string name = FormTool.CtrlName(dataType);

            while (true)
            {
                i++;
                if (container.Components[name + i.ToString()] == null)
                {
                    break;
                }
            }

            name = name + i.ToString();
            return(name);
        }