Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7996457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:42:51+00:00 2026-06-04T14:42:51+00:00

I have picture boxes added to a FlowLayout panel and a ContextMenu strip (associated

  • 0

I have picture boxes added to a FlowLayout panel and a ContextMenu strip (associated with picture boxes) with 'Add description' item.

When I right click on a PictureBox and select 'Add description', a new form pops with large preview of the picture and a text box to write the description.

How can I preserve the text written by the user on the new form, after it’s closed, so if user wants to edit the description, he doesn’t have to type it from scratch again?

I figured I’d have to store the description somewhere and load it into the form when user clicks on the same picture again, but how can I know what picture he clicked on?

There is probably a smarter way to go about this, but I can’t think of one right now, so I hope you guys can help me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T14:42:52+00:00Added an answer on June 4, 2026 at 2:42 pm

    You should be able to make use of Tag property to hold the picture description info.

    As for to identify the PictureBox on context you can make use of MouseEnter event. Basically Define a class level PictureBox variable (PictureBoxOnContext).

    Then you can add a MouseEnter event handler to the PictureBox instance and cast the sender to a PictureBox and assign it to the PictureBoxOnContext variable.

    when you right click on the PictureBox, MouseEnter is already triggered and the relavant PictureBox is selected into the PictureBoxOnContext variable.

    Then on the ‘Add description’ context menu click you can check if PictureBoxOnContext != null and pass this to the preview form.

    (rest you should be able to figure out; probably making use of delegates to pass back the information to parent form)

    private PictureBox PictureBoxOnContext;
    
    private void AddPicture_Click(object sender, EventArgs e)
    {
      PictureBox picBox = new PictureBox();   
      //Your code logic to add PictureBox to FlowLayout 
    
      picBox.MouseEnter += new EventHandler(PictueBox_MouseEnter);
    
    }
    
    void PictueBox_MouseEnter(object sender, EventArgs e)
    {
       PictureBoxOnContext = (PictureBox)sender;
    }
    
    
    private void AddDescriptionToolStripMenuItem_Click(object sender, EventArgs e)
    {
        if (PictureBoxOnContext != null)
        {
            //Pass this PictureBoxOnContext to your preview window/ your opearations
    
        PictureBoxOnContext = null;
    
        } 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using VS2010, Windows 7 I have a panel with lots of picture-boxes. It
I have 3x3 picture boxes on a form, what I want to do is
We have a WinForms application that includes controls such as picture boxes that are
I have a form with black background, with 9 picture boxes. When the program
I have a problem: I have 3 picture boxes with 3 different images as
I have the following problem: A program displays a picture using a PictureBox .
I have a form containing many picture boxes named pb_a1,pb_a2,pb_a3... and so on.. I
I have some code that creates panels with picture boxes in them. I would
In the program I have multiple panels being created with picture boxes. The picture
I have three select boxes. <div style='float: left; padding-right: 10px;'> <select size=10 name=company_id> //

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.