Exemplo n.º 1
0
 /// <summary>
 /// 返回所有插入实例的ID
 /// </summary>
 /// <returns></returns>
 public string GetIds()
 {
     try
     {
         //List<string> ids = new List<string>();
         string ids = "";
         for (int i = 0; i < panel_content.Controls.Count; i++)
         {
             if (i != 0)
             {
                 ucElement temp = (ucElement)panel_content.Controls[i];
                 ids = ids + "," + temp.Flagid;
             }
             else
             {
                 ucElement temp = (ucElement)panel_content.Controls[i];
                 ids = temp.Flagid;
             }
         }
         return(ids);
     }
     catch
     {
         return("");
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 释放ucElement控件
 /// </summary>
 public void disposeElement()
 {
     for (int i = 0; i < panel_content.Controls.Count; i++)
     {
         ucElement temp = (ucElement)panel_content.Controls[i];
         temp.Dispose();
     }
 }
        private void btnICD9_Click(object sender, EventArgs e)
        {
            ucICD9.setWidth(ucICD9.Width);
            frmUser us = new frmUser("ICD9");

            us.ShowDialog();
            if (ucElement.id != "" && ucElement.myName != "")
            {
                ucElement element = new ucElement(ucElement.myName, ucElement.id);
                ucICD9.createUser(element);
            }
        }
Exemplo n.º 4
0
 public void reArrangment()
 {
     for (int i = 0; i < panel_content.Controls.Count; i++)
     {
         ucElement temp = (ucElement)panel_content.Controls[i];
         if (i == 0)
         {
             temp.Left = panel_content.Location.X;
         }
         else
         {
             temp.Left = panel_content.Controls[i - 1].Left + panel_content.Controls[i - 1].Width;
         }
     }
 }
Exemplo n.º 5
0
        /// <summary>
        /// 插入ucElement控件
        /// </summary>
        /// <param name="user"></param>
        public void createUser(ucElement user)
        {
            for (int i = 0; i < panel_content.Controls.Count; i++)
            {
                ucElement temp = (ucElement)panel_content.Controls[i];
                if (user.Flagid == temp.Flagid)
                {
                    App.Msg("控件已存在");
                    return;
                }
            }
            if (panel_content.Controls.Count > 0)
            {
                user.Left = panel_content.Controls[panel_content.Controls.Count - 1].Left + panel_content.Controls[panel_content.Controls.Count - 1].Width;
            }
            else
            {
                user.Left = panel_content.Location.X;
            }

            user.Top    = panel_content.Location.Y;
            user.Height = panel_content.Height;
            panel_content.Controls.Add(user);
        }