Search KB Filter article types
Best-Practice - UserControls instead of Forms
Categories: UserControls, UserControls Switching
Tags: Developers, Navigation, 1. Beginner, 2. Intermediate, Navigation, Pre v6.3, v6.3, v6.4 and Later, 3. Advanced
Revision: 1
Posted: 28/March/2010
Updated: 08/Aug/2010
Status: Publish
Types: Article

Overview

This article describes a best-practice for Visual WebGui by which you would use UserControls instead of Forms for alternating the displayed UI.

Details

A Visual WebGui best practice is to only use Forms in these situations:

  • When you want to show dialog windows.
  • When you need different access points to your application Different Forms with which the application can start.


In all other situations the best practice would be to use UserControls instead of Forms.
Your Form could contain a UserControl with Dock.Fill on the Form for example and when you want to switch screens, you could simply set the Visible property of the UserControl to false and the Visible property of a different UserControl to true and the other one will be shown instead.

This will in turn allow you to:

  • Switch views very easily without having to use a mechanism for navigating to a different Form.
  • Get a much faster and more efficient switch between application views.
  • Choose the view you would like to start with based on your server-side logic (IP address or user permissions of the user for example) while the users are all still using the same page URL.
  • Have a much more organized application solution, as you will be able to store all your different views (UserControls) with their own specific functionalities, in designated project folders.
ReferencesCode Examples

Version 6.4 or newer is required to build the code sample sucessfully.

See Also

About the author

Related Articles

UserControls  
Title Update Author
This video demonstrates how to work with user controls.
Tags: Developers, Drag & Drop, 1. Beginner, 2. Intermediate, 3. Advanced, Customization, Layouting, Pre v6.3, v6.3, v6.4 and Later
01/Jan/2009    2009/01/01
This sample application was created on VWG v6.3.x. The creator of this application suggests that VWG v6.4 would give much greater flexibility.
Tags: Architects, Developers, Events, Resource Handlers, VB.NET, 2. Intermediate, 3. Advanced, Customization, Layouting, Pre v6.3, v6.3
07/Jan/2009    2009/01/07
Tags: Architects, Developers, Data Binding, 2. Intermediate, 3. Advanced, Data Binding, Pre v6.3, v6.3, v6.4 and Later
02/Jan/2009    2009/01/02
This sample code demonstrates working with user controls to simulate frames
Tags: Developers, Navigation, 1. Beginner, 2. Intermediate, Navigation, Pre v6.3, v6.3, v6.4 and Later, 3. Advanced
12/Jan/2007    2007/01/12
Tags: Developers, Navigation, 1. Beginner, 2. Intermediate, Navigation, Pre v6.3, v6.3, v6.4 and Later, 3. Advanced
23/July/2010    2010/07/23
Tags: Developers, Navigation, 1. Beginner, 2. Intermediate, Navigation, Pre v6.3, v6.3, v6.4 and Later, 3. Advanced
21/July/2010    2010/07/21
.NET Web, Cloud and Mobile application delivery platform | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2011 Visual WebGui®       Visual WebGui weblog on ASP.NET Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS