<hr>
When developing a Windows application using Visual Basic it is highly likely that the application will consist of multiple forms (otherwise known as windows). It is unlikely, however, that all of those forms will need to be displayed as soon as the application starts up. In fact, it is more likely that most of the forms will remain hidden until the user performs some action that requires a form to be displayed.
In this chapter we will cover the topic of hiding and showing forms when developing applications in Visual Basic.
[[Image:visual_studio_add_new_item.jpg]]
The ''Add New Item'' window allows new items of various types to be added to the project. For this example we just need to add a new Windows Form to the our application. With ''Windows Form'' selected in the window click on ''Add''. Visual Studio will now display an additional tab containing the second form:
[[Image:visual_studio_two_forms.jpg]]
A Windows form can be displayed in one of two modes, modal and non-modal. When a form is non-modal it means that other forms in the other forms in the application remain accessible to the user (in that they can still click on controls or use the keyboard in other forms).
When a form is modal, as soon as it is displayed all other forms in the application are disabled until the modal dialog is dismissed by the user. Modal forms are typically used when the user is required to complete a task before proceeding to another part of the application. In the following sections we will cover the creation of of both modal and non-modal forms in Visual Basic.
== Writing Visual Basic Code to Display a Non-Modal Form ==
Exception encountered, of type "Error"
[ad5ddb2b] /index.php/Special:MobileDiff/7204 Error from line 434 of /home/techotopia/includes/diff/DairikiDiff.php: Call to undefined function each()
Backtrace:
#0 /home/techotopia/includes/diff/DairikiDiff.php(544): DiffEngine->diag()
#1 /home/techotopia/includes/diff/DairikiDiff.php(344): DiffEngine->compareSeq()
#2 /home/techotopia/includes/diff/DairikiDiff.php(227): DiffEngine->diffLocal()
#3 /home/techotopia/includes/diff/DairikiDiff.php(721): DiffEngine->diff()
#4 /home/techotopia/includes/diff/DairikiDiff.php(859): Diff->__construct()
#5 /home/techotopia/includes/diff/DairikiDiff.php(980): MappedDiff->__construct()
#6 /home/techotopia/extensions/MobileFrontend/includes/diff/InlineDiffFormatter.php(99): WordLevelDiff->__construct()
#7 /home/techotopia/includes/diff/DiffFormatter.php(140): InlineDiffFormatter->changed()
#8 /home/techotopia/includes/diff/DiffFormatter.php(82): DiffFormatter->block()
#9 /home/techotopia/extensions/MobileFrontend/includes/diff/InlineDifferenceEngine.php(117): DiffFormatter->format()
#10 /home/techotopia/includes/diff/DifferenceEngine.php(797): InlineDifferenceEngine->generateTextDiffBody()
#11 /home/techotopia/includes/diff/DifferenceEngine.php(728): DifferenceEngine->generateContentDiffBody()
#12 /home/techotopia/extensions/MobileFrontend/includes/specials/SpecialMobileDiff.php(241): DifferenceEngine->getDiffBody()
#13 /home/techotopia/extensions/MobileFrontend/includes/specials/SpecialMobileDiff.php(135): SpecialMobileDiff->showDiff()
#14 /home/techotopia/extensions/MobileFrontend/includes/specials/MobileSpecialPage.php(53): SpecialMobileDiff->executeWhenAvailable()
#15 /home/techotopia/includes/specialpage/SpecialPage.php(384): MobileSpecialPage->execute()
#16 /home/techotopia/includes/specialpage/SpecialPageFactory.php(553): SpecialPage->run()
#17 /home/techotopia/includes/MediaWiki.php(281): SpecialPageFactory::executePath()
#18 /home/techotopia/includes/MediaWiki.php(714): MediaWiki->performRequest()
#19 /home/techotopia/includes/MediaWiki.php(508): MediaWiki->main()
#20 /home/techotopia/index.php(41): MediaWiki->run()
#21 {main}