RSS

Creating a Web Page Tweaking Helper Tool(Part 2)

March 9th, 2008 Posted in Software Development, Trails, Utilities

You can consider this Trail as beginner level. Those experienced with Visual Studio may want to skip ahead. 

I will be developing this application in C# using Visual Studio 2008. I generally use the professional edition but will be using the express edition for this Trail. You can download and use the Express edition for free. The application will be Windows Forms based and will have a graphical user interface.

The user will be able to create and load profiles. Profiles will consist of all the information needed for a particular application on a web site. This information will include the local hard drive directory, the FTP location of the directory on the web site and possibly some other configuration values. You will be able to create as many configuration files as you want and the data will be stored in XML files on your local hard drive.

A dialog will be created to enter and edit the configuration information. The main form will have an information section that will show the user what the application is doing and log all of the activity that has occurred. It will log when it has uploaded files to the web site. The rest of the main form will be used later for the web page view. The web page view will be discussed in later articles.

I will be going into detail about setting up the project in this article. The first step in the process is to fire up Visual Studio and create the project.

Step 1 - In Visual Studio select File - New Project…

Step 2 - In the New Project dialog select Windows Forms Application for the Template. Set the project name to WebTweaker. You will now have a Solution named WebTweaker containing a project named WebTweaker with a Project.cs and a Form1.cs.

Step 3 - Save the solution by either clicking the save icon or selecting File - Save All from the menu. A Save Project dialog will appear. Enter WebTweaker for the Name. I want to place my Trail projects in C:\Trails so I will enter C:\Trails for the Location. You can place your files wherever you want. Un-checkthe "Create directory for solution" check box. If you leave it checked your files will end up at c:\Trails\WebTweaker\WebTweaker which we don’t want. You should use the "Check directory for solution" option if you plan on having multiple projects in your solution.

Step 4 - Right click on From1.cs in the Solution Explorer and select Rename and set the name to MainForm.cs. A dialog will ask if you want to rename all references to the new name. You should answer ‘Yes’ to this question.

Step 5 - In the "MainForm.cs [Design]" tab you’ll see Form1. We need to change that to "Trails Web Tweaker". Right click on the Form1 window and select Properties from the pop-up menu. You should see the Properties window in the lower right hand corner of Visual Studio. The drop down box at the top of he Properties window should be set to "MainForm System.Windows.Forms.Form". Find the Text property and change it from Form1 to Trails Web Tweaker.

Web Tweaker ScreenShot 01

Step 6 - Now we want to add a menu to the application. Drag a MenuStrip control from the Toolbox window onto your "Trails Web Tweaker" window.

MenuStrip in Toolbox

Now you’ll have a menuStrip1 object at the bottom of Visual Studio below your main form. Right click on menuStrip1 and select Properties. Change the Name property from menuStrip1 to menuMain.

WebTweaker change menu name

Step 7 - In your "Trails Web Tweaker" main form window you’ll see a menu bar has been added with a "Type Here" box. Click the "Type Here" box and enter File and press enter. Now the "Type Here" box will be File and there will be two more "Type Here" boxes. The top box is for adding more top level menus. The bottom box is for adding items to the File menu we just created. Enter the following menu items under the File menu: New…, Open…, Change…,Save As…, Sync and Exit.

WebTweaker File Menu

In the next part of this Trail we’ll start implementing the menu items we just created.

Trails Web Tweaker Part 2 Source Code

Share and Enjoy:
  • StumbleUpon
  • Digg
  • Reddit
  • del.icio.us
  • Suggest to Techmeme via Twitter
  • Technorati
  • Slashdot
  • HackerNews
  • Twitter
  • Facebook
  • Print this article!

RSS feed | Trackback URI

Comments »

No comments yet.

Name (required)
E-mail (required - never shown publicly)
URI
Subscribe to comments via email
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped=""> in your comment.