示例#1
0
 public frmNewGroup(frmClient client)
 {
     InitializeComponent();
     ShortcutList = new List <ProgramShortcut>();
     ControlList  = new List <Control>();
     Client       = client;
 }
        public ucCategoryPanel(frmClient client, Category category)
        {
            InitializeComponent();
            Client        = client;
            Category      = category;
            lblTitle.Text = category.Name;
            picGroupIcon.BackgroundImage = LoadBitmap(@"config\" + Category.Name + @"\GroupImage.png"); //getting icon from file

            // starting values for position of shortcuts
            int x       = 90;
            int y       = 55;
            int columns = 1;

            foreach (ProgramShortcut psc in this.Category.ShortcutList) // since this is calculating uc height it cant be placed in load
            {
                if (columns == 8)
                {
                    x            = 90; // resetting x
                    y           += 40; // adding new row
                    this.Height += 40;
                    columns      = 1;
                }
                CreateShortcut(x, y, psc);
                x += 50;
                columns++;
            }
        }