C#
  Home arrow C# arrow C# Simplified, part 6: Working with Window...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
Moblin 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
C#

C# Simplified, part 6: Working with Windows Applications
By: Anand Narayanaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 18
    2005-06-07

    Table of Contents:
  • C# Simplified, part 6: Working with Windows Applications
  • My first WinForm application
  • Code Analysis
  • Working with WinForm controls using Visual Studio .NET

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    C# Simplified, part 6: Working with Windows Applications


    (Page 1 of 4 )

    In this article, you will learn about Windows-based applications by creating and modifying one. You will also learn two ways to create controls for these applications, and why TextBoxes are particularly important.

    If you have worked with Visual Basic 6.0 or Visual C++ 6.0, you may be  aware of the various Graphical User Interface (GUI) elements with which you worked. These elements include buttons, text boxes, check boxes, radio buttons and many more. In fact there are dozens of other controls which are used, along with various Windows-based applications. Windows-based applications are called WinForms for short. With WinForms, you can develop standalone applications. This means that you can run those applications only under a Windows platform and with the .NET Framework. The end user should either install .NET Framework or .NET redistributable framework in order to work with Windows-based applications. If you want to develop ASP.NET applications, you should use WebForm controls.

    The System.Windows.Forms namespace provides all necessary classes and methods for developing powerful GUI applications. It is this namespace which provides access to WinForm controls and their associated methods and properties. If you are using a plain text editor instead of Visual Studio .NET, you have to know about the various properties and their corresponding values. But if you have Visual Studio .NET, the properties for each of the controls can be modified from the properties window, and the appropriate coding will be automatically done in the background. The compilation and execution stages are same as any other C# application. The only difference is that the output can be viewed through a Form. The source code will become lengthy as you develop complex application with WinForms.

    The code samples in this article assume that you are using a plain text editor such as Notepad for coding purposes.

    The .NET Framework supplies more than 60 controls for developing Windows applications. Even though all these controls are not used in a single project, they can be suitably used for various purposes. For example, if you are developing a data entry project, you can make use of TextBoxes and Validation Controls. If you are working on a billing project, you can use Buttons, DataGrid and CheckBoxes. The usage of these controls depends upon each project's requirements.

    If you have Visual Studio .NET, you can view the names of all these controls from the ToolBox. Just place your mouse pointer over the ToolBox section on the left hand side and the Visual Studio .NET automatically displays all the controls. As you can see, these controls are divided into tabs. For instance, the controls used for developing database applications are located in a tab titled "Data." In the same way, reusable and user created controls are placed in a tab titled "Components."

    The different types of controls used for building a WinForm application is given in Figure 6.1.

    I will explain some of the important controls shown in the above figure in this article and in the upcoming articles. You can learn about rest of the controls which are not discussed in this series with the help of the MSDN library or the documentation which came with the .NET Framework SDK.

    Visual Studio .NET supports a feature called Dynamic Help. In order to make use of this feature you have to install the MSDN library which came with Visual Studio .NET. To understand its functionality, add a control like Timer to the form and press F1.

    More C# Articles
    More By Anand Narayanaswamy


     

    C# ARTICLES

    - Color Transformation in C# GDI+ Programming
    - Exceptions in C#
    - Overriding versus Overloading
    - Value Types and Reference Types
    - Defining Member and Type Visibility
    - Managing Files in C#
    - Working with Windows Registry in C#
    - Lossless Image Resizing in C#
    - Lossless Image Converting in C#
    - Creating an RSS Feed with ASP.Net Written in...
    - Polymorphism in C#
    - Inheritance in C#
    - C# Events Explained
    - C# Delegates Explained
    - C# StreamReader and StreamWriter Explained





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway