コード例 #1
0
ファイル: LibraryForm.cs プロジェクト: Vinschers/manga-reader
        private void AddBooksToPanel()
        {
            pnlBooks.Controls.Clear();
            pnlBooks.AutoScroll = true;

            int height = 0;

            foreach (Book book in library.Books)
            {
                var th = new TitleHolder(library, book);
                th.Margin   = new Padding(0);
                th.Location = new Point(50, height);
                th.Name     = book.GetFileName();
                height     += th.Height;
                pnlBooks.Controls.Add(th);
            }

            foreach (Control c in pnlBooks.Controls)
            {
                if (c is TitleHolder)
                {
                    c.BringToFront();
                    return;
                }
            }
        }
コード例 #2
0
ファイル: LibraryForm.cs プロジェクト: Vinschers/manga-reader
        private void BtnRefresh_Click(object sender, EventArgs e)
        {
            library.Refresh();

            if (!IsEqualPanelLibrary())
            {
                AddBooksToPanel();
            }

            var th = new TitleHolder();

            AdjustPanel(th.Width + 50 + SystemInformation.VerticalScrollBarWidth, 3 * th.Height);
        }