Results 1 to 8 of 8

Thread: hide/unhide :)

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2008
    Posts
    16

    Resolved hide/unhide :)

    Well i want to create a button where it hides bit of my program and when u click that buttton again it unhides it...

    how do i do that?
    Last edited by pooffck; Oct 19th, 2008 at 10:38 AM.

  2. #2
    Fanatic Member
    Join Date
    Feb 2001
    Posts
    759

    Re: hide/unhide :)

    Are you trying to hide your code from the IDE or not run the code while the program is running? Please explain more.

  3. #3
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    Re: hide/unhide :)

    It depends a lot on a lot of specifics, but you hide/show a form with Form.Hide or Form.Show. You can hide all forms with

    vb Code:
    1. Dim frm As Form
    2. For Each frm in Forms
    3.     frm.Hide
    4. Next

    But, this'll hide all of your forms, so the user won't be able to give input to your program again (assuming a simple program here). You can keep from hiding the form that calls this "hide" routine with this:

    vb Code:
    1. Dim frm As Form
    2. For Each frm In Forms
    3.     If Not (frm Is Me) Then frm.Hide
    4. Next frm

    Using my magical skills of telepathy, it sounds like maybe you want this done using a task bar icon? If so these forums have a lot of info on doing that, accessible via a search.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Aug 2008
    Posts
    16

    Re: hide/unhide :)

    example

    1


    and when u click OPEN (as u cant see there



    it opens up the sidebar with more info and u can hide that....

  5. #5
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: hide/unhide :)

    change the width property of the form to suit
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  6. #6
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: hide/unhide :)

    There is also the visible property of the controls that you can set...
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  7. #7
    Hyperactive Member jp26198926's Avatar
    Join Date
    Sep 2008
    Location
    General Santos City, Philippines
    Posts
    310

    Re: hide/unhide :)

    see my attachment

    edit:


    Code:
    Private Sub cmdShow_Click()
    If cmdShow.Caption = "S H O W" Then
         ' code  to show
         cmdShow.Caption = "H I D E"
    Else
         ' code to hide
         cmdShow.Caption = "S H O W"
    End If
    End Sub
    Attached Files Attached Files
    Last edited by jp26198926; Oct 19th, 2008 at 10:27 AM.

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Aug 2008
    Posts
    16

    Resolved Re: hide/unhide :)

    Quote Originally Posted by jp26198926
    see my attachment

    edit:


    Code:
    Private Sub cmdShow_Click()
    If cmdShow.Caption = "S H O W" Then
         ' code  to show
         cmdShow.Caption = "H I D E"
    Else
         ' code to hide
         cmdShow.Caption = "S H O W"
    End If
    End Sub
    You are da man :P

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