Click here to Skip to main content
15,881,938 members
Articles / Programming Languages / XML

RSS Consumer

Rate me:
Please Sign up or sign in to vote.
4.14/5 (11 votes)
12 May 2005CPOL2 min read 75K   1.1K   35  
Building an application to read RSS feeds.
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace RSSConsumer
{
	/// <summary>
	/// Summary description for frmAddGroup.
	/// </summary>
	public class frmAddGroup : System.Windows.Forms.Form
	{
		private System.Windows.Forms.TextBox txtGroup;
		private System.Windows.Forms.Button btnOk;
		private System.Windows.Forms.Button btnCancel;
		private System.Windows.Forms.Label label1;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public frmAddGroup()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.txtGroup = new System.Windows.Forms.TextBox();
			this.btnOk = new System.Windows.Forms.Button();
			this.btnCancel = new System.Windows.Forms.Button();
			this.label1 = new System.Windows.Forms.Label();
			this.SuspendLayout();
			// 
			// txtGroup
			// 
			this.txtGroup.Location = new System.Drawing.Point(56, 8);
			this.txtGroup.Name = "txtGroup";
			this.txtGroup.Size = new System.Drawing.Size(296, 20);
			this.txtGroup.TabIndex = 1;
			this.txtGroup.Text = "";
			// 
			// btnOk
			// 
			this.btnOk.Location = new System.Drawing.Point(200, 40);
			this.btnOk.Name = "btnOk";
			this.btnOk.TabIndex = 2;
			this.btnOk.Text = "&Ok";
			this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
			// 
			// btnCancel
			// 
			this.btnCancel.Location = new System.Drawing.Point(280, 40);
			this.btnCancel.Name = "btnCancel";
			this.btnCancel.TabIndex = 3;
			this.btnCancel.Text = "&Cancel";
			this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(8, 12);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(48, 16);
			this.label1.TabIndex = 3;
			this.label1.Text = "Group";
			// 
			// frmAddGroup
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(362, 72);
			this.Controls.Add(this.label1);
			this.Controls.Add(this.btnCancel);
			this.Controls.Add(this.btnOk);
			this.Controls.Add(this.txtGroup);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
			this.Name = "frmAddGroup";
			this.Text = "Add Group";
			this.Load += new System.EventHandler(this.frmAddGroup_Load);
			this.ResumeLayout(false);

		}
		#endregion

		private void frmAddGroup_Load(object sender, System.EventArgs e)
		{
			
		}

		private void btnOk_Click(object sender, System.EventArgs e)
		{
			if(!txtGroup.Text.Trim().Equals("")) 
			{
				RSSConsumer.ConsumerMain.strNewGroup=txtGroup.Text.Trim();    
				this.DialogResult=DialogResult.OK;
			}
			else
			{
				this.DialogResult=DialogResult.Cancel; 
			}
			this.Close(); 
			
		}

		private void btnCancel_Click(object sender, System.EventArgs e)
		{
			this.DialogResult=DialogResult.Cancel; 
			this.Close(); 
		}

		
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Team Leader
India India
Techincal Architect

16 years of overall work experience.

Proven Expertise in Agile process implementation.

Managed complex projects through their lifecycle.

Methodologies used include Agile, SDLC, Waterfall models.

Comments and Discussions