PRB: Modal Form Does Not Appear in the Taskbar
This article was previously published under Q178754
This article has been archived. It is offered "as is" and will no longer be updated.
A form displayed modally does not appear in the taskbar.
To have a form appear in the taskbar, show the form as a non-modal form.The MORE INFORMATION section below shows how to show a form in the taskbar.
This behavior is by design.
By Windows user interface design standards, modal forms do not appear inthe system taskbar. The next section shows you how to create a sampleproject that simulates a modal form so that the form appears in thetaskbar.
- Start a new Standard EXE project in Visual Basic. Form1 is created by default.
- Add a CommandButton to the Form1 form.
- Add a second Form to the project. Add a CommandButton to the Form2 form.
- Copy the following code to the Code window of the Form1 form:
Option Explicit Private Sub Command1_Click() Form1.Enabled = False Form2.Show End Sub
- Copy the following code to the Code window of the Form2 form:
Option Explicit Private Sub Command1_Click() Unload Form2 Form1.Enabled = True Form1.SetFocus End Sub
- On the Run menu, click Start or press the F5 key to start the program. On the Form1 form, click the CommandButton to display the Form2 form. Note that the Form2 form also appears in the taskbar.
kbVBp500 kbVBp600 kbVBp kbdsd kbDSupport kbVBA
Article ID: 178754 - Last Review: 02/24/2014 08:31:38 - Revision: 3.0
Microsoft Visual Basic 5.0 Learning Edition, Microsoft Visual Basic 6.0 Learning Edition, Microsoft Visual Basic 5.0 Professional Edition, Microsoft Visual Basic 6.0 Professional Edition, Microsoft Visual Basic 5.0 Enterprise Edition, Microsoft Visual Basic 6.0 Enterprise Edition
- kbnosurvey kbarchive kbprb KB178754