using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;

namespace vclass.chat
{
	/// <summary>
	/// Summary description for tabPage.
	/// </summary>
	public class tabPage : System.Windows.Forms.TabPage
	{
		private System.Windows.Forms.RichTextBox RTBChat;
		private System.Windows.Forms.Button BClose;
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;
		private Color color;

		public tabPage(string name)
		{
			// This call is required by the Windows.Forms Form Designer.
			InitializeComponent();
			this.Text = name;
			this.Name = name;
	//		this.BackColor = System.Drawing.SystemColors.Desktop;

			// TODO: Add any initialization after the InitializeComponent call
	//		this.Text = tabName;
		}

		public int Add(string message,string color,string font)
		{
			this.RTBChat.SelectionFont = Font.FromHfont(new IntPtr(Int32.Parse(font)));
			this.RTBChat.SelectionColor = Color.FromArgb(Int32.Parse(color));
			Console.WriteLine("Tabpage->Add: "+this.RTBChat.SelectionColor.Name);
			this.RTBChat.AppendText(message);
			return 1;
		}

		/// <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 Component 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()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(tabPage));
			this.RTBChat = new System.Windows.Forms.RichTextBox();
			this.BClose = new System.Windows.Forms.Button();
			this.SuspendLayout();
			// 
			// RTBChat
			// 
			this.RTBChat.Location = new System.Drawing.Point(0, 0);
			this.RTBChat.Name = "RTBChat";
			this.RTBChat.ReadOnly = true;
			this.RTBChat.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.ForcedVertical;
			this.RTBChat.Size = new System.Drawing.Size(480, 160);
			this.RTBChat.TabIndex = 0;
			this.RTBChat.Text = "";
			// 
			// BClose
			// 
			this.BClose.Image = ((System.Drawing.Image)(resources.GetObject("BClose.Image")));
			this.BClose.Location = new System.Drawing.Point(448, 0);
			this.BClose.Name = "BClose";
			this.BClose.Size = new System.Drawing.Size(16, 16);
			this.BClose.TabIndex = 1;
			// 
			// tabPage
			// 
			this.Controls.Add(this.BClose);
			this.Controls.Add(this.RTBChat);
			this.Name = "tabPage";
			this.Size = new System.Drawing.Size(480, 160);
			this.ResumeLayout(false);

		}
		#endregion
	}
}
