Results 1 to 5 of 5

Thread: Minimise to tray problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    7

    Question

    Ok, I know how to minimise a form to the tray via command buttons but how can I do it when someone clicks the 'Minimise' button on the form? Is there an event for that, I know it can be done because many programs use it but I can't figure out how!!

    Can someone please help

    Cheers

    Vishal
    vishal3k@yahoo.co.nz

  2. #2
    Guest
    Code:
    Private Sub Form_Resize()
    
    If Me.WindowState = vbMinimized Then
     'Minimize to tray code goes here
    End If
    
    End Sub
    That should do the trick, shouldn't it? It would look a little cheesy though. It would minimze to the taskbar and disappear, but that's the closest I've ever got to minimizing to the tray.

  3. #3

  4. #4

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    7

    Smile It kind of works

    Actually that would work if you have the ShowInTaskbar property set to false!

    But does anyone have a code that would also work when you have the ShowInTaskbar property to true.

    cheers

    Vishal

  5. #5
    Guest
    Is it possible to change ShowInTaskbar at run-time, or is it only availible at design time?

    Otherwise:

    Code:
    Private Sub Form_Resize()
    
    If Me.WindowState = vbMinimized Then
     Me.ShowInTaskbar = False
     'Minimize to tray code goes here
    Else
     Me.ShowInTaskBar = True
    End If
    
    End Sub
    If that doesn't work I dunno what will, unless you want to use DrawFrameControl and create your own titlebar. I've done that several times so I could use images in the titlebar rather than text. Also one time I wanted to make the title bar go down the side to see what it was like.

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