CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2005
    Location
    Israel
    Posts
    1,475

    Control visible does not work

    I have a very strange problem. Any help will be appriciated.
    I have a form with few controls. The controls are invisible, and when the user performs some operations the controls ahould become visible.
    Code:
    control.Visible = true;
    I put a breakpoint in this line, but the control's Visible property stays "false" and the control does not become visible.

    Any idea what can cause this phenomenon?

  2. #2
    Join Date
    Jul 2002
    Location
    India
    Posts
    505

    Re: Control visible does not work

    Very strange...

    Sure it is not this?

    http://msdn.microsoft.com/smartclien...aspx#Qwe98hdqa

    -Satish

  3. #3
    Join Date
    Feb 2005
    Location
    Israel
    Posts
    1,475

    Re: Control visible does not work

    It is contained in a visible usercontrol. The form itself is contained in an MFC form (by setting the parent of the form to be the MFC form).
    This looks like a bug in windows, because even if the control is visible, the .NET framework seems to think it is not visible:
    Code:
    control.Visible = true;
    if (!control.Visible)
       MessageBox.Show("Not visible");
    And even if the control is visible the messagebox is shown.
    Have no idea what this means.

  4. #4
    Andy Tacker is offline More than "Just Another Member"
    Join Date
    Jun 2001
    Location
    55°50' N 37°39' E
    Posts
    1,503

    Re: Control visible does not work

    may be they are located inside another control, and the property of that control is set to invisible?
    If you think you CAN, you can, If you think you CAN'T, you are probably right.

    Have some nice Idea to share? Write an Article Online or Email to us and You may WIN a Technical Book from CG.

  5. #5
    Join Date
    Feb 2005
    Location
    Israel
    Posts
    1,475

    Re: Control visible does not work

    This is not the case for me.
    I kind of solved the problem by placing the Visible = false inside the Load event, instead of setting it in the designer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured