By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,703 Members | 1,242 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,703 IT Pros & Developers. It's quick & easy.

myControl.Hide vs myControl.visible=false

P: n/a
Is there any difference between:

myControl.Hide vs myControl.visible=false

and also:

myControl.Show vs myControl.visible=true

They seem to do the same thing. Any tips on when to use one over the
other?

Thanks for all your help!

John

Nov 21 '05 #1
Share this Question
Share on Google+
5 Replies

P: n/a
"johnb41" <or****@informatik.com> schrieb:
Is there any difference between:

myControl.Hide vs myControl.visible=false

and also:

myControl.Show vs myControl.visible=true

They seem to do the same thing. Any tips on when to use one over the
other?


The 'Hide' method simply sets the control's 'Visible' property to 'False',
so it doesn't have any disadvantages to use one instead of the other.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2

P: n/a
"johnb41" <or****@informatik.com> schrieb:
Is there any difference between:

myControl.Hide vs myControl.visible=false

and also:

myControl.Show vs myControl.visible=true

They seem to do the same thing. Any tips on when to use one over the
other?


The 'Hide' method simply sets the control's 'Visible' property to 'False',
so it doesn't have any disadvantages to use one instead of the other.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #3

P: n/a
Thanks Herfried. I had a hunch that was the case, but found no
evidense when googleing it.

John

Nov 21 '05 #4

P: n/a
"johnb41" <or****@informatik.com> schrieb:
Thanks Herfried. I had a hunch that was the case, but found no
evidense when googleing it.


I checked the implementation with Lutz Roeder's Reflector.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #5

P: n/a
John,
The documentation for Control.Hide states "Hiding the control is equivalent
to setting the Visible property to false", while Control.Show states
"Showing the control is equivalent to setting the Visible property to true".

http://msdn.microsoft.com/library/de...shidetopic.asp

http://msdn.microsoft.com/library/de...sshowtopic.asp

I don't see where any more "evidence" is needed! ;-) Although as Herfried
suggests, you could use ILDASM or Reflector to see specifically what the
above remarks mean...

Hope this helps
Jay

"johnb41" <or****@informatik.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
| Thanks Herfried. I had a hunch that was the case, but found no
| evidense when googleing it.
|
| John
|
Nov 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.