none
My Visible property won't turn to true!

    Question

  • Hello! I am creating a project in which, once a person has decided which spaces to place his/her items, a picturebox showing that item appears. In code, when I try to set the visible property to true, it just remains false and doesn't display. Please help.
    Monday, May 23, 2016 3:17 PM

Answers

  • Hello! I am creating a project in which, once a person has decided which spaces to place his/her items, a picturebox showing that item appears. In code, when I try to set the visible property to true, it just remains false and doesn't display. Please help.

    Setting the visible property to True doesn't mean the picturebox instantly becomes seen. Your method needs to return to permit the message loop to be pumped. (In C# WinForm applications, the message pump is hidden from view, but generally speaking is executed when you return from your method calls).

    If you aren't satisfied with this explanation, perhaps you can show your code.

    Monday, May 23, 2016 3:29 PM
  • Visible is a special property: when it is read, it takes into consideration the visibility of parent and ancestor controls too. Therefore, make sure that the parent controls are visible as well.

    Monday, May 23, 2016 6:02 PM

All replies

  • Hello! I am creating a project in which, once a person has decided which spaces to place his/her items, a picturebox showing that item appears. In code, when I try to set the visible property to true, it just remains false and doesn't display. Please help.

    Setting the visible property to True doesn't mean the picturebox instantly becomes seen. Your method needs to return to permit the message loop to be pumped. (In C# WinForm applications, the message pump is hidden from view, but generally speaking is executed when you return from your method calls).

    If you aren't satisfied with this explanation, perhaps you can show your code.

    Monday, May 23, 2016 3:29 PM
  • Visible is a special property: when it is read, it takes into consideration the visibility of parent and ancestor controls too. Therefore, make sure that the parent controls are visible as well.

    Monday, May 23, 2016 6:02 PM