Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Minimize Form
I've programmed a Form in Excel 1997. When the form is activated for
data entry, it takes up the entire screen with the excel workbook behind the scenes. Someone asked me if there was a way they could "minimize" the Form so they can work on other applications, multi-task. To work on other applications, they currently have to exit the Form by clicking on the red X in the upper right hand corner of the Form. This shuts down the form completely. Is there a way I can program the Form to be minimized, just like I might minimize Microsoft Word so I can work on something else? I don't want to have to shut down the form to work with other software. Ideally, I'd like to be able to easily toggle from my Form to any other open application. I'd also like to toggle from an open application, like Word, to my Form. Any assistance you can provide would be greatly appreciated. Thanks. Michael |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Minimize Form
Good afternoon Michael Use this before your first procedure in the userforms code: Private Declare Function SetWindowLong& Lib "user32" Alias "SetWindowLongA" (ByVal hwnd&, ByVal nIndex&, ByVal wNewWord&) Private Declare Function FindWindow& Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) Public usrcell As String and then just add this in to your Userform_Initialize event (or just add it to the bottom of your code if you don't have one). Private Sub UserForm_Initialize() Dim hwnd& hwnd = FindWindow(vbNullString, Me.Caption) SetWindowLong hwnd, -16, &H84CA0080 End Sub HTH DominicB -- dominicb ------------------------------------------------------------------------ dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932 View this thread: http://www.excelforum.com/showthread...hreadid=377685 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Minimize a form | Excel Programming | |||
Minimize the VB form | Excel Programming | |||
Minimize the VB form | Excel Programming | |||
Minimize a form | Excel Programming | |||
How to minimize a form using VB | Excel Programming |