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 815013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:36:50+00:00 2026-05-15T01:36:50+00:00

I have a Panel which hosts a number of child controls in a grid

  • 0

I have a Panel which hosts a number of child controls in a grid layout. The child controls each consist of a Panel with a PictureBox and a Label. When one of these child controls is clicked it becomes “selected” (which basically entails changing its background to a different color) and an event is fired. In the handler for this event, an image is displayed in a PictureBox on a separate form.

In code, the background of the child control is definitely changed before firing the event, but for some reason it never updates at runtime until after the image has updated in the other Form. I’ve tried to Invalidate() and Refresh() the child control before firing the event, without effect.

Why is this happening, and what can I do to set it right?

  • 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-05-15T01:36:51+00:00Added an answer on May 15, 2026 at 1:36 am

    If I remember right, the methods associated with the event get executed in the same thread where the event was raised, so the UI thread is blocked with executing the picture change in the seperate form. As a solution, use an additional thread (eg. via ThreadPool) to execute the event. By this, the code will continue and the UI can be redrawn.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a panel which displays a form with an arbitrary number of JTextFields
I have a panel which consists of a toolbar and tabs. On each tab
i have a panel (A), which contains 3 other panels (AA, AB, AC). Each
I have panel which is using flow layout. How can I make break in
i have a panel which iam showing as pop up with few textbox controls
I have an ExtJS Panel which contains a label in the first row and
I have a stack panel for which AllowDrop property is true and I have
I have web form with a panel which has form elements in side it.
I have a panel with transparent background which i use to draw an image.
I have a preferences panel in my application in which I have a NSColorWell

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.