Home arrow C# arrow Page 4 - Creating a .NET Windows Installer – Part 1
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Creating a .NET Windows Installer – Part 1 - The Sample Project
(Page 4 of 14 )

In this article we will create an installer for the .NET project shown below.

This simple application allows the user to choose a font from a drop-down list. The font is drawn onto the form surface in a Paint event handler. The form code (aside from the Windows designer region) is shown below:

public class main : System.Windows.Forms.Form
{
    private void main_Load(object sender, EventArgs e)
    {
        InstalledFontCollection fonts = new InstalledFontCollection();
        foreach (FontFamily family in fonts.Families)
        {
            lstFonts.Items.Add(family.Name);
        }
    }

    private void main_Paint(object sender, PaintEventArgs e)
    {
        if (lstFonts.Text != "")
        {
            try
            {
                e.Graphics.DrawString(lstFonts.Text, new Font(lstFonts.Text,
                                      50), Brushes.Black, 10, 50);
                statusBar.Panels[0].Text = "";
            }
            catch (Exception err)
            {
                statusBar.Panels[0].Text = err.Message;
            }
        }
    }

    private void lstFonts_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (lstFonts.Text != "") this.Invalidate();
    }
}


blog comments powered by Disqus
C# ARTICLES

- Introduction to Objects and Classes in C#, P...
- Visual C#.NET, Part 1: Introduction to Progr...
- C# - An Introduction
- Hotmail Exposed: Access Hotmail using C#
- Razor Sharp C#
- Introduction to Objects and Classes in C#
- Making Your Code CLS Compliant
- Programming with MySQL and .NET Technologies
- Socket Programming in C# - Part II
- Socket Programming in C# - Part I
- Creational Patterns in C#
- Type Conversions
- Creating Custom Delegates and Events in C#
- Inheritance and Polymorphism
- Understanding Properties in C#

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 9 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials