private void PopulateCategories() { foreach (GalleryCategory category in ChartGallery.Categories) { PageControlPage page = new PageControlPage(); page.Text = Res.Get("Forms,ChartGallery,Categories," + category.Name).Replace("&", "&&"); page.Parent = pcPages; page.Dock = DockStyle.Fill; page.BackColor = SystemColors.Window; PopulateCategory(category, page); } }
private void AddPage(object sender, EventArgs e) { IDesignerHost host = ((IDesignerHost)base.GetService(typeof(IDesignerHost))); DesignerTransaction transaction = host.CreateTransaction("Add Page"); PageControlPage page = host.CreateComponent(typeof(PageControlPage)) as PageControlPage; FPageControl.Controls.Add(page); page.Dock = DockStyle.Fill; page.BackColor = SystemColors.Window; page.Text = "Page" + FPageControl.Controls.Count.ToString(); FPageControl.ActivePage = page; transaction.Commit(); }
private void PopulateCategory(GalleryCategory category, PageControlPage page) { ListView listView = new ListView(); listView.Parent = page; listView.Location = new Point(16, 32); listView.Size = new Size(page.Width - 16, page.Height - 32); listView.LargeImageList = ChartGallery.Images; listView.BorderStyle = BorderStyle.None; listView.SelectedIndexChanged += new EventHandler(listView_SelectedIndexChanged); listView.DoubleClick += new EventHandler(listView_DoubleClick); foreach (GalleryItem item in category.Items) { ListViewItem lvItem = listView.Items.Add(Res.Get("Forms,ChartGallery,Series," + item.Name)); lvItem.ImageIndex = item.ImageIndex; lvItem.Tag = item.SeriesType; } }
private void AddPages(DesignerOptionsPage page) { if (page != null) { foreach (TabPage tab in page.tc1.TabPages) { PageControlPage panel = new PageControlPage(); panel.Text = tab.Text; panel.Dock = DockStyle.Fill; panel.BackColor = SystemColors.Window; while (tab.Controls.Count > 0) { tab.Controls[0].Parent = panel; } pageControl1.Controls.Add(panel); } FOptionsPages.Add(page); page.Init(); } }