public FormPhotosSearchByFilter(FBLogic i_FBLogic) { InitializeComponent(); r_FBLogic = i_FBLogic; r_FBLogic.CreatePhotosSearchByFilterLogic(); m_CollectionPicSettings = new FormPhotosSearchByFilterSettings(r_FBLogic); m_CurrPictureDate = new Label(); m_AmountOfFilterPerCurrPic = new Label(); m_ViewPicture = new FadePictureBox(); BuildForm(); if (!m_ToClose) { ShowDialog(); } else { Close(); } }
private void buildAndDisplayPictureBoard() { int indexOfCurrPicAndLabel = 0; int pictureBoxsLocationWidth = k_SpeaceBetweenPictureBoxs; int pictureBoxsLocationHeight = 0; int pictureBoxsSize = 120; int labelLocationHeght = pictureBoxsLocationHeight + pictureBoxsSize + pictureBoxsLocationWidth; m_MyCollectionPicIterator.Reset(); while (m_MyCollectionPicIterator.MoveNext()) { FadePictureBox buildPictures = new FadePictureBox(); buildPictures.Size = new Size(pictureBoxsSize, pictureBoxsSize); buildPictures.Location = new Point(pictureBoxsLocationWidth, pictureBoxsLocationHeight); pictureBoxsLocationWidth += pictureBoxsSize + k_SpeaceBetweenPictureBoxs; buildPictures.Load(m_MyCollectionPicIterator.Current.PictureNormalURL); buildPictures.SizeMode = PictureBoxSizeMode.StretchImage; Label numOfFilteredLabel = new Label(); numOfFilteredLabel.AutoSize = true; numOfFilteredLabel.Text = string.Format("Number of {0}: {1}", m_CollectionPicSettings.m_filterBy, r_FBLogic.GetAmountBySorterPerPhoto(m_MyCollectionPicIterator.Current)); numOfFilteredLabel.Location = new Point(pictureBoxsLocationWidth - pictureBoxsSize, labelLocationHeght); buildPictures.Tag = indexOfCurrPicAndLabel; Controls.Add(numOfFilteredLabel); panel1.Controls.Add(buildPictures); panel1.Controls.Add(numOfFilteredLabel); buildPictures.MouseClick += BuildPictures_MouseClick; indexOfCurrPicAndLabel++; panel1.Refresh(); } panel1.VerticalScroll.Maximum = 0; panel1.AutoScroll = false; panel1.VerticalScroll.Visible = false; panel1.AutoScroll = true; pictureBoxsLocationWidth += k_SpeaceBetweenPictureBoxs; buildViewPicture(); }
private void BuildPictures_MouseClick(object sender, MouseEventArgs e) { FadePictureBox pic = sender as FadePictureBox; displayCurrPic(pic.ImageLocation, (int)pic.Tag); }