Forms Task Changes in VB.NET

The following article provides a list of tasks that can be performed with forms and their methodologies.
  • 2282

There are many differences between Windows Forms and Visual Basic 6.0 Forms. The following table provides a list of tasks that can be performed with forms and their methodologies. You can use this list to transition your existing Visual Basic 6.0 Forms projects to the new .NET Framework model for Windows Forms.
 

Task Visual Basic 6.0 Forms Windows Forms
Set the Tab Indexing for all the controls on a form. Select each control on the form and set itsTabIndexproperty to the next number in the tab order for your form. From the View menu choose Tab Order. The form displays a numeral next to each control that represents the control'sTabIndex property setting. Click on each control in the desired tab order. For more information, see Setting the Tab Order on Windows Forms.
Determine the modifier key (ALT, SHIFT, CTRL) pressed during keyboard and mouse events. Use the parameters provided by the mouse event handler. Compare the Form class'sModifierKeys method against the modifier key value, found in the Keysenumeration. For more information, seeDetermining Which Modifier Key Was Pressed
Align or size controls based on the location and size of a single control. Click on each control to align or size. The last control selected is used to determine the location and size of all controls selected. Click on each control to align or size. The first control selected is used to determine the location and size of all controls selected. For more information, see Aligning Multiple Controls on Windows Forms.
Change the name of a form. Change the name specified in the Nameproperty of the form in the Properties window. Click on the form's class file in the Solution Explorer and then change the Filename property in the Properties window.
Change the run-time display position of a form. Use the Form Layout window to position the form, or set its Startupproperty in the Properties window. With the form selected in the Windows Forms Designer, set theStartPosition property in the Properties window.
Display a form as a dialog box. In code, use the Showmethod and specify that the form be displayed modally using thevbModalvalue. In code, use theShowDialog method of the form. For details, seeDisplaying Dialog Boxes for Windows Forms.
Group or layer controls on a form. Layer the controls within theFramecontrol. To move the controls as a group, select them all. Place the controls within a GroupBox control. Moving the group box moves the controls as well.
Iterate through the controls on a form. Use a control array. Use the Controls Collection. For details, see Collections in Visual Basic .NET.

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.