Results 1 to 18 of 18

Thread: [2005] Hide control subcontrols

Threaded View

  1. #10
    PowerPoster VBDT's Avatar
    Join Date
    Sep 2005
    Location
    CA - USA
    Posts
    2,922

    Re: [2005] Hide control subcontrols

    VB Code:
    1. 'Hides the control with the specified control-name.
    2.         For Each cont As Control In Me.Controls
    3.             If cont.Name = "the name of the control" Then
    4.                 cont.Visible = False
    5.             End If
    6.         Next
    7.  
    8.         'Hides all Lable controls on the form.
    9.         For Each cont As Control In Me.Controls
    10.             If cont.GetType.Name = "Lable" Then
    11.                 cont.Visible = False
    12.             End If
    13.         Next
    14.         'Hides all the controls.
    15.         For Each cont As Control In Me.Controls
    16.             cont.Visible = False
    17.         Next
    You can set the visible properties of the controls by setting it to true the same way.
    Not these does not hide controls that are in a container! These are fine for your project since you don't have controls in a container.

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