//-------------------------------------- // SHORTCUT PANEL HANLDERS //-------------------------------------- // Load up shortcut panel public void LoadShortcut(ProgramShortcut psc, int position) { pnlShortcuts.AutoScroll = false; ucProgramShortcut ucPsc = new ucProgramShortcut(this, psc, position); pnlShortcuts.Controls.Add(ucPsc); ucPsc.Show(); ucPsc.BringToFront(); if (pnlShortcuts.Controls.Count < 6) { pnlShortcuts.Height += 50; pnlAddShortcut.Top += 50; } ucPsc.Location = new Point(25, (pnlShortcuts.Controls.Count * 50) - 50); pnlShortcuts.AutoScroll = true; }
public void LoadShortcuts() { pnlShortcuts.Height = 0; pnlShortcuts.Controls.Clear(); int y = 0; int position = 0; foreach (ProgramShortcut psc in Category.ShortcutList) { ucProgramShortcut ucPsc = new ucProgramShortcut(this, psc, position); pnlShortcuts.Controls.Add(ucPsc); ucPsc.Location = new Point(0, y); ucShortcutList.Add(ucPsc); ucPsc.Show(); ucPsc.BringToFront(); position++; if (pnlShortcuts.Height < 350) { y += 50; pnlShortcuts.Height += 50; } else { pnlShortcuts.ScrollControlIntoView(ucPsc); } } if (pnlShortcuts.Height >= 350) { if (!pnlShortcuts.AutoScroll) { pnlShortcuts.AutoScroll = true; pnlShortcuts.Width += 40; } } pnlAdd.Top = pnlShortcuts.Bottom; //if (pnlAdd.Bottom > pnlEnd.Top) //{ // this.Height += 50; // pnlEnd.Top += 50; //} //this.Height = pnlAdd.Bottom + 75; }