Diesel Posted August 7, 2004 Posted August 7, 2004 I was just wondering what the difference is between calling the Show function on a control or setting visible equal to true? Quote
sjn78 Posted August 7, 2004 Posted August 7, 2004 Show is what you use essentially to confirm and place your control. Dim c as New control() form1.controls.add© 'puts it on the form c.Show() ' now shows it ------------ Dim c as New control() form1.controls.add© 'puts it on the form c.visible = false 'makes it invisible c.Show() ' now shows it, but its invisible ------------ Dim c as New control() form1.controls.add© 'puts it on the form c.visible = true 'makes it visible but since there is no show, nothing will appear Quote
Joe Mamma Posted August 8, 2004 Posted August 8, 2004 t looks like "Show" calls "Visible = true" results in 6 more code lines Il DASM for Control.show() .method public hidebysig instance void Show() cil managed { // Code size 8 (0x8) .maxstack 8 IL_0000: ldarg.0 IL_0001: ldc.i4.1 IL_0002: call instance void System.Windows.Forms.Control::set_Visible(bool) IL_0007: ret } // end of method Control::Show Il DASM for Control.Visible() .method public hidebysig specialname instance void set_Visible(bool 'value') cil managed { // Code size 8 (0x8) .maxstack 8 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: callvirt instance void System.Windows.Forms.Control::SetVisibleCore(bool) IL_0007: ret } // end of method Control::set_Visible Quote Joe Mamma Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.
wyrd Posted August 8, 2004 Posted August 8, 2004 Straight form MSDN docs; http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformscontrolclassshowtopic.asp Showing the control is equivalent to setting the Visible property to true. After the Show method is called, the Visible property returns a value of true until the Hide method is called. In short, there is no difference. Quote Gamer extraordinaire. Programmer wannabe.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.