Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    mex
    mex is offline
    Regular Coder
    Join Date
    Jul 2003
    Location
    somewhere
    Posts
    134
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Minimize to Taskbar using VB

    Can anyone get me a script to minimize the form to the taskbar instead of the normal mode and also to disable the maximize and close! thanx
    Wonder

  • #2
    Super Moderator sage45's Avatar
    Join Date
    May 2002
    Posts
    1,059
    Thanks
    0
    Thanked 13 Times in 13 Posts
    Almost everthing that you have asked can be accomplished using the Form Properties in the object.

    Set WindowState to Minimized.
    Set MaxButton to False.
    Set MinButton to False.

    You can also add something like:

    frmName.WindowState = 1 ' 0 = Normal; 1 = Minimized; 2 = Maximized

    To your code, where frmName is the name of the form or object you wish to minimize.

    As for trying to get rid of the close button. You cannot do that, however, what you can do is incorporate logic into your program that can be used to keep the program open or collect pertinant data, restart the program and import the pertinant data back into the program.

    HTH,

    -sage-
    HTML & CSS Forum Moderator

    "If you don't know what you think you know, then what do you know."
    R.I.P. Derrick Thomas #58
    1/1/1967 - 2/8/2000

  • #3
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    Additionally you can use the API functions to send a message to the window causing it to 'iconify' as Microsoft puts it.
    Omnis mico antequam dominus Spookster!

  • #4
    Regular Coder anarchy3200's Avatar
    Join Date
    Mar 2003
    Location
    England
    Posts
    261
    Thanks
    0
    Thanked 1 Time in 1 Post
    If i understand what you are saying with the close/maximize button then you can set ControlBox to false but this will get rid of the minimize button aswell (dont know if you want this)
    Mike

  • #5
    Super Moderator sage45's Avatar
    Join Date
    May 2002
    Posts
    1,059
    Thanks
    0
    Thanked 13 Times in 13 Posts
    You don't have to set the minimize button to false. You can leave it active if you choose...

    -sage-
    HTML & CSS Forum Moderator

    "If you don't know what you think you know, then what do you know."
    R.I.P. Derrick Thomas #58
    1/1/1967 - 2/8/2000


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •