Home All Groups Group Topic Archive Search About

setting property on button fails

Author
11 Oct 2005 3:08 PM
Jazper Manto
hi

i've tried to set the Visible property on a System.Windows.Forms.Button on
the form_load() event. this method normaly process correctly. however as i
played around with the software for testing reasons, suddenly this Visible
property on the button could not be set anymore. i tried it in the IDE at
runtime by watch windows and commandline window. i can set it, but it will
be set back after assignment (watch the attachement to see what i mean).

can anybody guess what the problem is or what i did wrong?
thanx, jazper

[attached file: cmd_wnd.jpg]

Author
12 Oct 2005 8:43 AM
Frans Bouma [C# MVP]
Jazper Manto wrote:

> hi
>
> i've tried to set the Visible property on a
> System.Windows.Forms.Button on the form_load() event. this method
> normaly process correctly. however as i played around with the
> software for testing reasons, suddenly this Visible property on the
> button could not be set anymore. i tried it in the IDE at runtime by
> watch windows and commandline window. i can set it, but it will be
> set back after assignment (watch the attachement to see what i mean).
>
> can anybody guess what the problem is or what i did wrong?
> thanx, jazper

    Could be something with inter-process messaging and security. After
all, changing the visibility of a button is doing a SendMessage() under
the hood with a proper HWnd but the IDE isn't owner of that.

    If you add a second button and when you click that button, it will set
the visibility property of the     btnSetTake button, does that work?

        FB

--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Author
13 Oct 2005 5:53 PM
Jazper Manto
hi frans

thank you for your answer.

> If you add a second button and when you click that button, it will set
> the visibility property of the btnSetTake button, does that work?

yes, that worked.

everything takes its time... eat something, smoke a cigarette and restart
the computer. i really don't know what happen to that VS.net IDE. everything
works fine again after a restart of the complete system. this is a sh*tty
solution for a sh*tty problem. but it solved my problem :-)

sorry that you've waisted your time with my request, frans.
thanx again, jazper

AddThis Social Bookmark Button