473,387 Members | 1,844 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

myControl.Hide vs myControl.visible=false

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
5 3757
"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
"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
Thanks Herfried. I had a hunch that was the case, but found no
evidense when googleing it.

John

Nov 21 '05 #4
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: awightma | last post by:
Hi, I have a datagrid with a number of textboxes on it. I want one column of my table to be visible=false because it contains the id of the record from the table. For some reason when I set...
1
by: Marc Lefebvre | last post by:
Why I was unable to hide the previous button in the following code ? private void ButtonClick(Object sender, System.EventArgs e) { Button button = (Button)sender; Button previousButton =...
8
by: tshad | last post by:
I have a column in a list where I need to keep track of some data (but not show it) and am setting it as false. This works fine in IE, but Netscape and Mozilla show a little space where the column...
2
by: kaosyeti | last post by:
i can't get this working. in vba i tried to set visible to false in an if statement that looked like this: Private Sub GroupFooter1_Format(Cancel As Integer, FormatCount As Integer) If...
1
by: walanta | last post by:
I'm trying to get rid of the TextBox1 and Button1 on the page after posted back. However, it's still visible. Any idea why? protected void Page_Load(object sender, EventArgs e) { if...
4
by: Jimmy Stewart | last post by:
I have a calculated control "ContactInfo" on my form ... ="Attn: " & In the OnCurrent event for the form I have the following code... If Me.Contact Is Null Then Me.ContactInfo.Visible = False...
1
by: pdm | last post by:
hoi access, I have a subreport and with the id of inheritance of OOP I like to reuse this subreport in other main reports and hide some fields. First, is this possible and second what is the...
0
by: dvsriram | last post by:
hii , I am using Font class as property and showing in the propertygrid . Now i want to show only the font dialog in the propertygrid . The remaining things below the Font ...
2
by: lenniekuah | last post by:
Hullo Good Friends, I need your help. Please Help me. I am trying to pass the name of the Calling FORM FRMSALES to the Loaded FORM FRMPOPUPCustomers so that FRMPOPUPCustomer will set the FRMSALES...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.