A couple of days ago, I wrote a post telling you that in order for you to be the most effective as you can in internet marketing you will need to learn a programming language. The programming language I suggested that you should learn is C#. Well, I hope you took my advice because it’s time to start writing some C# applications and we’re going to jump right in by learning how to design an RSS Reader. I’m not going to go into details right now about why it’s necessary to know how to read RSS. Just trust me in the fact that it is a necessary skill to learn if you seriously want to create some automation tools to enhance your internet marketing career.
Now, the first thing you need to do is to fire up C# Express and create a new Windows Form Application. You do that by clicking File > New Project… and selecting “Windows Forms Application” from the list. Go ahead and pick a suitable name for your RSS Reader and click the OK button. Once you’ve done that, you should see a new form with the title “Form1″.
Click anywhere in the grey area of this form and you should see a panel on the right that says “Properties” and lists all of the properties for this control. Scroll down and change the form Title to something creative or leave it alone for now and continue on. You can also change the name of the form if you want, but this too isn’t required. It just makes things easier to follow as the application grows.
The next thing you need to do is to add some controls to make this thing functional. To do that, click on the Label control in your Toolbox panel and drag it to your form. Just drop it anywhere and it will appear as something like “label1″. Back in your Properties window, with the label selected, scroll down and change the Text property to “URL:”. Then, drag the URL label to the top left corner of the window.
Next, drag a TextBox control from your Toolbox panel onto your form. Change the name of this text box to “txtFeed”. Since our form can be resized and / or maximized, we need to tell the txtFeed text box to grow with the form as the window gets resized. To do this, click on the txtFeed text box and drop down the Anchor property in the Properties panel. Leave Left & Top selected and click on Right as well. This tells the text box that you want it to stay anchored to the top, left, and now the right sides of the form whenever the window gets resized. Don’t worry about the width of the text box just yet as we’ll take care of that after the next step.
For the next step, we need to drag a Button control from the Toolbox panel onto our form. Once we have it there, we need to change it’s name to “btnRun” and the text to “Run”. Then, we need to move this button and the txtFeed text box just to the right of the URL label we created earlier. Position the btnRun button all the way to the right side of the form, leaving just a little bit of space between the button and the edge. If you haven’t changed anything in C# Express, your controls will “snap-to-grid” by default and should line up nicely with minimum effort.
After you’ve moved your btnRun button and txtFeed text box into the correct positions, go ahead and stretch the txtFeed text box until it snaps into place next to the btnRun button. Now, just like we did above for the txtFeed text box, we need to set the Anchor property for the btnRun button. So, click the btnRun button and drop down the arrow for the Anchor property in the Properties panel. Check the right anchor, but unlike before, this time we need to uncheck the left anchor. If we do not uncheck the left anchor, the button will act just like the txtFeed text box, but will end up covering up the txtFeed text box since it’s left anchor is set at design time.
The last control that we need to add is a ListView control. This will act as our grid for displaying our RSS results. So, drag a ListView control from the Toolbox panel onto the form and stretch it so that it fills up the remainder of the screen below our other controls. Then, using the Properties panel, set the Anchor property for the ListView to Top, Right, Bottom, and Left so that the entire ListView will grow and shrink as the window gets resized. Also, change the name of the ListView to “lstFeeds” as we will be relying on this name in the code. To get the ListView looking more like a grid, you will need to change it’s View property to “Details”. Next we’ll need to add some columns. So, click on the Columns property for the ListView in the Properties panel and you should see a screen for adding columns. Go ahead and add 2 columns; one with text “Title” and the other with text “Description”. Feel free to change the widths of the columns so that they are easily viewable in the ListView. I set my columns widths so that they are evenly divided by the width of the ListView itself giving me a 50% – 50% ratio.
Pages: 1 2
