Minimize form using a command button

HyMaX
HyMaX used Ask the Experts™
on
I want to know how to minimize a form by clicking on a command button.
Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Me.WindowState = vbMinimized
Commented:
hi HyMax
 you need to set the windowstate of form which you need to minimize to 1 or vbminimized. you need to write this in command click event as below
private sub command1_click()
//to minimize
me.windowstate=1
//to maxmize
me.windowstate=2
//set to 0 to normal
EndSub
To increase readbility use the vb constants, not the integer value.
The FormWindowState Constants:

vbMaximized 'Value = 2
vbMinimized 'Value = 1
vbNormal 'Value = 0

Author

Commented:
Thank you epochs, perfect!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial