private void ArticleForm_Load(object sender, EventArgs e) { this.Text = articleName; labelTitelArticle.Text = articleName; labelTitelArticle.BringToFront(); labelTitelArticle.Left = (this.ClientSize.Width - labelTitelArticle.Width) / 2; txtArticleText.Text = smamControl.GetArticleText(articleName); //test string articleID = smamControl.GetArticleID(articleName); foreach (string URL in smamControl.GetImageURL(articleID)) { Image image = new Image(URL); //nieuw object aanmaken Console.WriteLine(URL); //debuggen PictureBox p = new PictureBox(); //nieuwe picturebox maken p.Size = new System.Drawing.Size(75, 75); //formaat instellen p.Location = new System.Drawing.Point(12 + 120 * i, 524); //locatie instellen Console.WriteLine(p.Location.ToString()); //debuggen this.Controls.Add(p); //toevoegen aan form p.Load(URL); //link laden i++; //voor locatie picturebox } foreach (Control c in Controls) { if (c is PictureBox && c.Name != "pictureBox1") //zijn er plaatjes bij het artikel { txtArticleText.Height = 466; break; } else { txtArticleText.Height = 547; } } loadBG(); //achtergrond laden }
private void ArticleForm_Load(object sender, EventArgs e) { labelTitelArticle.Text = articleName; labelTitelArticle.Left = (this.ClientSize.Width - labelTitelArticle.Width) / 2; txtArticleText.Text = smamControl.GetArticleText(articleName); //test string articleID = smamControl.GetArticleID(articleName); foreach (string URL in smamControl.GetImageURL(articleID)) { Image image = new Image(URL); //nieuw object aanmaken Console.WriteLine(URL); //debuggen PictureBox p = new PictureBox(); //nieuwe picturebox maken p.Size = new System.Drawing.Size(75, 75); //formaat instellen p.Location = new System.Drawing.Point(252, 52 + 81 * i); //locatie instellen Console.WriteLine(p.Location.ToString()); //debuggen this.Controls.Add(p); //toevoegen aan form p.Load(URL); //link laden i++; //voor locatie picturebox } foreach (Control c in Controls) { if (c is PictureBox) { txtArticleText.Width = 234; break; } else { txtArticleText.Width = 315; } } }