Click here to Skip to main content
15,896,320 members
Home / Discussions / C#
   

C#

 
GeneralRe: form close Pin
mpastchenko16-Sep-05 12:27
mpastchenko16-Sep-05 12:27 
Questionc# procedure Pin
Jassim Rahma26-Aug-05 10:39
Jassim Rahma26-Aug-05 10:39 
AnswerRe: c# procedure Pin
Colin Angus Mackay26-Aug-05 11:24
Colin Angus Mackay26-Aug-05 11:24 
GeneralRe: c# procedure Pin
Jassim Rahma26-Aug-05 12:52
Jassim Rahma26-Aug-05 12:52 
GeneralRe: c# procedure Pin
Dave Kreskowiak26-Aug-05 14:20
mveDave Kreskowiak26-Aug-05 14:20 
GeneralRe: c# procedure Pin
Jassim Rahma26-Aug-05 20:48
Jassim Rahma26-Aug-05 20:48 
GeneralRe: c# procedure Pin
Dave Kreskowiak27-Aug-05 2:59
mveDave Kreskowiak27-Aug-05 2:59 
GeneralRe: c# procedure Pin
Jassim Rahma27-Aug-05 3:38
Jassim Rahma27-Aug-05 3:38 
ok.. here is the full code for both... with many thanks...


first Form_A which contains the method..

using System;<br />
using System.Drawing;<br />
using System.Collections;<br />
using System.ComponentModel;<br />
using System.Windows.Forms;<br />
<br />
namespace Ezi_Work<br />
{<br />
	/// <summary><br />
	/// Summary description for ezi_life_form.<br />
	/// </summary><br />
	public class frmEziLife : System.Windows.Forms.Form<br />
	{<br />
		// NewEziForm;<br />
		frmEziLife_New NewEziForm = new frmEziLife_New();<br />
<br />
		// new_record_id;<br />
		public int new_record_id;<br />
<br />
		private System.Windows.Forms.MenuItem menuItem5;<br />
		private System.Windows.Forms.MenuItem mnuNew;<br />
		private System.Windows.Forms.MenuItem mnuOpen;<br />
		private System.Windows.Forms.MenuItem mnuClose;<br />
		private System.Windows.Forms.MainMenu mnuEziLife;<br />
		private System.Windows.Forms.MenuItem mnuMain;<br />
		private System.Windows.Forms.MenuItem mnuPrint;<br />
		private System.Windows.Forms.MenuItem mnuEdit;<br />
		private System.Windows.Forms.MenuItem menuItem2;<br />
		private System.Windows.Forms.MenuItem menuItem3;<br />
		private System.Windows.Forms.Label lblName;<br />
		private System.Windows.Forms.TabControl tabControl1;<br />
		private System.Windows.Forms.TabPage tabGL;<br />
		private System.Windows.Forms.TabPage tabPA;<br />
		private System.Windows.Forms.TabPage tabTreaty;<br />
		private System.Windows.Forms.Label label1;<br />
		private System.Windows.Forms.Label label2;<br />
		private System.Windows.Forms.Label label3;<br />
		private System.Windows.Forms.Label label4;<br />
		private System.Windows.Forms.Label label5;<br />
		private System.Windows.Forms.Label label6;<br />
		private System.Windows.Forms.Label label7;<br />
		private System.Windows.Forms.Label label8;<br />
		private System.Windows.Forms.Label label9;<br />
		private System.Windows.Forms.Label label10;<br />
		private System.Windows.Forms.Label label11;<br />
		private System.Windows.Forms.Label label12;<br />
		private System.Windows.Forms.Label label13;<br />
		private System.Windows.Forms.Label label14;<br />
		private System.Windows.Forms.Label label15;<br />
		private System.Windows.Forms.Label label16;<br />
		private System.Windows.Forms.Label label17;<br />
		private System.Windows.Forms.Label label18;<br />
		private System.Windows.Forms.Label label19;<br />
		private System.Windows.Forms.Label label20;<br />
		private System.Windows.Forms.Label label21;<br />
		private System.Windows.Forms.Label label22;<br />
		private System.Windows.Forms.Label label23;<br />
		private System.Windows.Forms.Label label24;<br />
		private System.Windows.Forms.Label label25;<br />
		private System.Windows.Forms.Label label26;<br />
		private System.Windows.Forms.GroupBox groupBox1;<br />
		private System.Windows.Forms.Label label27;<br />
		private System.Windows.Forms.Label label28;<br />
		private System.Windows.Forms.Label label29;<br />
		private System.Windows.Forms.Label label30;<br />
		private System.Windows.Forms.Label label31;<br />
		private System.Windows.Forms.Label label32;<br />
		private System.Windows.Forms.Label label33;<br />
		private System.Windows.Forms.Label label34;<br />
		private System.Windows.Forms.Button button1;<br />
		private System.Windows.Forms.Button button2;<br />
		private System.Windows.Forms.Button button3;<br />
		private System.Windows.Forms.Button button4;<br />
		/// <summary><br />
		/// Required designer variable.<br />
		/// </summary><br />
		private System.ComponentModel.Container components = null;<br />
<br />
		public frmEziLife()<br />
		{<br />
			//<br />
			// Required for Windows Form Designer support<br />
			//<br />
			InitializeComponent();<br />
<br />
			//<br />
			// TODO: Add any constructor code after InitializeComponent call<br />
			//<br />
		}<br />
<br />
		/// <summary><br />
		/// Clean up any resources being used.<br />
		/// </summary><br />
		protected override void Dispose( bool disposing )<br />
		{<br />
			if( disposing )<br />
			{<br />
				if(components != null)<br />
				{<br />
					components.Dispose();<br />
				}<br />
			}<br />
			base.Dispose( disposing );<br />
		}<br />
<br />
		#region Windows Form Designer generated code<br />
		/// <summary><br />
		/// Required method for Designer support - do not modify<br />
		/// the contents of this method with the code editor.<br />
		/// </summary><br />
		private void InitializeComponent()<br />
		{<br />
			this.mnuEziLife = new System.Windows.Forms.MainMenu();<br />
			this.mnuMain = new System.Windows.Forms.MenuItem();<br />
			this.mnuNew = new System.Windows.Forms.MenuItem();<br />
			this.mnuOpen = new System.Windows.Forms.MenuItem();<br />
			this.menuItem5 = new System.Windows.Forms.MenuItem();<br />
			this.mnuEdit = new System.Windows.Forms.MenuItem();<br />
			this.mnuPrint = new System.Windows.Forms.MenuItem();<br />
			this.menuItem3 = new System.Windows.Forms.MenuItem();<br />
			this.menuItem2 = new System.Windows.Forms.MenuItem();<br />
			this.mnuClose = new System.Windows.Forms.MenuItem();<br />
			this.lblName = new System.Windows.Forms.Label();<br />
			this.tabControl1 = new System.Windows.Forms.TabControl();<br />
			this.tabGL = new System.Windows.Forms.TabPage();<br />
			this.tabPA = new System.Windows.Forms.TabPage();<br />
			this.tabTreaty = new System.Windows.Forms.TabPage();<br />
			this.label1 = new System.Windows.Forms.Label();<br />
			this.label2 = new System.Windows.Forms.Label();<br />
			this.label3 = new System.Windows.Forms.Label();<br />
			this.label4 = new System.Windows.Forms.Label();<br />
			this.label5 = new System.Windows.Forms.Label();<br />
			this.label6 = new System.Windows.Forms.Label();<br />
			this.label7 = new System.Windows.Forms.Label();<br />
			this.label8 = new System.Windows.Forms.Label();<br />
			this.label9 = new System.Windows.Forms.Label();<br />
			this.label10 = new System.Windows.Forms.Label();<br />
			this.label11 = new System.Windows.Forms.Label();<br />
			this.label12 = new System.Windows.Forms.Label();<br />
			this.label13 = new System.Windows.Forms.Label();<br />
			this.label14 = new System.Windows.Forms.Label();<br />
			this.label15 = new System.Windows.Forms.Label();<br />
			this.label16 = new System.Windows.Forms.Label();<br />
			this.label17 = new System.Windows.Forms.Label();<br />
			this.label18 = new System.Windows.Forms.Label();<br />
			this.label19 = new System.Windows.Forms.Label();<br />
			this.label20 = new System.Windows.Forms.Label();<br />
			this.label21 = new System.Windows.Forms.Label();<br />
			this.label22 = new System.Windows.Forms.Label();<br />
			this.label23 = new System.Windows.Forms.Label();<br />
			this.label24 = new System.Windows.Forms.Label();<br />
			this.label25 = new System.Windows.Forms.Label();<br />
			this.label26 = new System.Windows.Forms.Label();<br />
			this.groupBox1 = new System.Windows.Forms.GroupBox();<br />
			this.label27 = new System.Windows.Forms.Label();<br />
			this.label28 = new System.Windows.Forms.Label();<br />
			this.label29 = new System.Windows.Forms.Label();<br />
			this.label30 = new System.Windows.Forms.Label();<br />
			this.label31 = new System.Windows.Forms.Label();<br />
			this.label32 = new System.Windows.Forms.Label();<br />
			this.label33 = new System.Windows.Forms.Label();<br />
			this.label34 = new System.Windows.Forms.Label();<br />
			this.button1 = new System.Windows.Forms.Button();<br />
			this.button2 = new System.Windows.Forms.Button();<br />
			this.button3 = new System.Windows.Forms.Button();<br />
			this.button4 = new System.Windows.Forms.Button();<br />
			this.tabControl1.SuspendLayout();<br />
			this.tabGL.SuspendLayout();<br />
			this.tabPA.SuspendLayout();<br />
			this.tabTreaty.SuspendLayout();<br />
			this.groupBox1.SuspendLayout();<br />
			this.SuspendLayout();<br />
			// <br />
			// mnuEziLife<br />
			// <br />
			this.mnuEziLife.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {<br />
																					   this.mnuMain});<br />
			// <br />
			// mnuMain<br />
			// <br />
			this.mnuMain.Index = 0;<br />
			this.mnuMain.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {<br />
																					this.mnuNew,<br />
																					this.mnuOpen,<br />
																					this.menuItem5,<br />
																					this.mnuEdit,<br />
																					this.mnuPrint,<br />
																					this.menuItem3,<br />
																					this.menuItem2,<br />
																					this.mnuClose});<br />
			this.mnuMain.Text = "&Ezi-Life";<br />
			// <br />
			// mnuNew<br />
			// <br />
			this.mnuNew.Index = 0;<br />
			this.mnuNew.Shortcut = System.Windows.Forms.Shortcut.CtrlN;<br />
			this.mnuNew.Text = "&New";<br />
			this.mnuNew.Click += new System.EventHandler(this.mnuNew_Click);<br />
			// <br />
			// mnuOpen<br />
			// <br />
			this.mnuOpen.Index = 1;<br />
			this.mnuOpen.Shortcut = System.Windows.Forms.Shortcut.CtrlO;<br />
			this.mnuOpen.Text = "&Open";<br />
			// <br />
			// menuItem5<br />
			// <br />
			this.menuItem5.Index = 2;<br />
			this.menuItem5.Text = "-";<br />
			// <br />
			// mnuEdit<br />
			// <br />
			this.mnuEdit.Index = 3;<br />
			this.mnuEdit.Shortcut = System.Windows.Forms.Shortcut.F2;<br />
			this.mnuEdit.Text = "Edit";<br />
			// <br />
			// mnuPrint<br />
			// <br />
			this.mnuPrint.Index = 4;<br />
			this.mnuPrint.Shortcut = System.Windows.Forms.Shortcut.CtrlP;<br />
			this.mnuPrint.Text = "&Print";<br />
			// <br />
			// menuItem3<br />
			// <br />
			this.menuItem3.Index = 5;<br />
			this.menuItem3.Shortcut = System.Windows.Forms.Shortcut.F5;<br />
			this.menuItem3.Text = "&Refresh";<br />
			// <br />
			// menuItem2<br />
			// <br />
			this.menuItem2.Index = 6;<br />
			this.menuItem2.Text = "-";<br />
			// <br />
			// mnuClose<br />
			// <br />
			this.mnuClose.Index = 7;<br />
			this.mnuClose.Shortcut = System.Windows.Forms.Shortcut.F10;<br />
			this.mnuClose.Text = "C&lose";<br />
			this.mnuClose.Click += new System.EventHandler(this.mnuClose_Click);<br />
			// <br />
			// lblName<br />
			// <br />
			this.lblName.AutoSize = true;<br />
			this.lblName.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(178)));<br />
			this.lblName.ForeColor = System.Drawing.Color.Blue;<br />
			this.lblName.Location = new System.Drawing.Point(16, 16);<br />
			this.lblName.Name = "lblName";<br />
			this.lblName.Size = new System.Drawing.Size(42, 18);<br />
			this.lblName.TabIndex = 0;<br />
			this.lblName.Text = "label1";<br />
			// <br />
			// tabControl1<br />
			// <br />
			this.tabControl1.Controls.Add(this.tabGL);<br />
			this.tabControl1.Controls.Add(this.tabPA);<br />
			this.tabControl1.Controls.Add(this.tabTreaty);<br />
			this.tabControl1.Location = new System.Drawing.Point(16, 48);<br />
			this.tabControl1.Name = "tabControl1";<br />
			this.tabControl1.SelectedIndex = 0;<br />
			this.tabControl1.Size = new System.Drawing.Size(320, 224);<br />
			this.tabControl1.TabIndex = 1;<br />
			// <br />
			// tabGL<br />
			// <br />
			this.tabGL.Controls.Add(this.label26);<br />
			this.tabGL.Controls.Add(this.label25);<br />
			this.tabGL.Controls.Add(this.label24);<br />
			this.tabGL.Controls.Add(this.label23);<br />
			this.tabGL.Controls.Add(this.label22);<br />
			this.tabGL.Controls.Add(this.label21);<br />
			this.tabGL.Controls.Add(this.label20);<br />
			this.tabGL.Controls.Add(this.label7);<br />
			this.tabGL.Controls.Add(this.label6);<br />
			this.tabGL.Controls.Add(this.label5);<br />
			this.tabGL.Controls.Add(this.label4);<br />
			this.tabGL.Controls.Add(this.label3);<br />
			this.tabGL.Controls.Add(this.label2);<br />
			this.tabGL.Controls.Add(this.label1);<br />
			this.tabGL.Location = new System.Drawing.Point(4, 22);<br />
			this.tabGL.Name = "tabGL";<br />
			this.tabGL.Size = new System.Drawing.Size(312, 198);<br />
			this.tabGL.TabIndex = 0;<br />
			this.tabGL.Text = "G.L.";<br />
			// <br />
			// tabPA<br />
			// <br />
			this.tabPA.Controls.Add(this.label19);<br />
			this.tabPA.Controls.Add(this.label18);<br />
			this.tabPA.Controls.Add(this.label17);<br />
			this.tabPA.Controls.Add(this.label16);<br />
			this.tabPA.Controls.Add(this.label11);<br />
			this.tabPA.Controls.Add(this.label10);<br />
			this.tabPA.Controls.Add(this.label9);<br />
			this.tabPA.Controls.Add(this.label8);<br />
			this.tabPA.Location = new System.Drawing.Point(4, 22);<br />
			this.tabPA.Name = "tabPA";<br />
			this.tabPA.Size = new System.Drawing.Size(312, 198);<br />
			this.tabPA.TabIndex = 1;<br />
			this.tabPA.Text = "P.A.";<br />
			// <br />
			// tabTreaty<br />
			// <br />
			this.tabTreaty.Controls.Add(this.label15);<br />
			this.tabTreaty.Controls.Add(this.label14);<br />
			this.tabTreaty.Controls.Add(this.label13);<br />
			this.tabTreaty.Controls.Add(this.label12);<br />
			this.tabTreaty.Location = new System.Drawing.Point(4, 22);<br />
			this.tabTreaty.Name = "tabTreaty";<br />
			this.tabTreaty.Size = new System.Drawing.Size(312, 198);<br />
			this.tabTreaty.TabIndex = 2;<br />
			this.tabTreaty.Text = "Treaty";<br />
			// <br />
			// label1<br />
			// <br />
			this.label1.AutoSize = true;<br />
			this.label1.Location = new System.Drawing.Point(24, 24);<br />
			this.label1.Name = "label1";<br />
			this.label1.Size = new System.Drawing.Size(79, 16);<br />
			this.label1.TabIndex = 0;<br />
			this.label1.Text = "Average Rate :";<br />
			// <br />
			// label2<br />
			// <br />
			this.label2.AutoSize = true;<br />
			this.label2.Location = new System.Drawing.Point(24, 120);<br />
			this.label2.Name = "label2";<br />
			this.label2.Size = new System.Drawing.Size(51, 16);<br />
			this.label2.TabIndex = 1;<br />
			this.label2.Text = "Loading :";<br />
			// <br />
			// label3<br />
			// <br />
			this.label3.AutoSize = true;<br />
			this.label3.Location = new System.Drawing.Point(24, 96);<br />
			this.label3.Name = "label3";<br />
			this.label3.Size = new System.Drawing.Size(55, 16);<br />
			this.label3.TabIndex = 2;<br />
			this.label3.Text = "Net Rate :";<br />
			// <br />
			// label4<br />
			// <br />
			this.label4.AutoSize = true;<br />
			this.label4.Location = new System.Drawing.Point(24, 72);<br />
			this.label4.Name = "label4";<br />
			this.label4.TabIndex = 3;<br />
			this.label4.Text = "Passive War Add. :";<br />
			// <br />
			// label5<br />
			// <br />
			this.label5.AutoSize = true;<br />
			this.label5.Location = new System.Drawing.Point(24, 48);<br />
			this.label5.Name = "label5";<br />
			this.label5.Size = new System.Drawing.Size(96, 16);<br />
			this.label5.TabIndex = 4;<br />
			this.label5.Text = "Volume Discount :";<br />
			// <br />
			// label6<br />
			// <br />
			this.label6.AutoSize = true;<br />
			this.label6.Location = new System.Drawing.Point(24, 168);<br />
			this.label6.Name = "label6";<br />
			this.label6.Size = new System.Drawing.Size(92, 16);<br />
			this.label6.TabIndex = 5;<br />
			this.label6.Text = "Global Premium :";<br />
			// <br />
			// label7<br />
			// <br />
			this.label7.AutoSize = true;<br />
			this.label7.Location = new System.Drawing.Point(24, 144);<br />
			this.label7.Name = "label7";<br />
			this.label7.Size = new System.Drawing.Size(67, 16);<br />
			this.label7.TabIndex = 6;<br />
			this.label7.Text = "Gross Rate :";<br />
			// <br />
			// label8<br />
			// <br />
			this.label8.AutoSize = true;<br />
			this.label8.Location = new System.Drawing.Point(16, 24);<br />
			this.label8.Name = "label8";<br />
			this.label8.Size = new System.Drawing.Size(79, 16);<br />
			this.label8.TabIndex = 2;<br />
			this.label8.Text = "Average Rate :";<br />
			// <br />
			// label9<br />
			// <br />
			this.label9.AutoSize = true;<br />
			this.label9.Location = new System.Drawing.Point(16, 96);<br />
			this.label9.Name = "label9";<br />
			this.label9.Size = new System.Drawing.Size(92, 16);<br />
			this.label9.TabIndex = 3;<br />
			this.label9.Text = "Global Premium :";<br />
			// <br />
			// label10<br />
			// <br />
			this.label10.AutoSize = true;<br />
			this.label10.Location = new System.Drawing.Point(16, 72);<br />
			this.label10.Name = "label10";<br />
			this.label10.Size = new System.Drawing.Size(67, 16);<br />
			this.label10.TabIndex = 4;<br />
			this.label10.Text = "Gross Rate :";<br />
			// <br />
			// label11<br />
			// <br />
			this.label11.AutoSize = true;<br />
			this.label11.Location = new System.Drawing.Point(16, 48);<br />
			this.label11.Name = "label11";<br />
			this.label11.Size = new System.Drawing.Size(55, 16);<br />
			this.label11.TabIndex = 5;<br />
			this.label11.Text = "Net Rate :";<br />
			// <br />
			// label12<br />
			// <br />
			this.label12.AutoSize = true;<br />
			this.label12.Location = new System.Drawing.Point(16, 24);<br />
			this.label12.Name = "label12";<br />
			this.label12.Size = new System.Drawing.Size(77, 16);<br />
			this.label12.TabIndex = 3;<br />
			this.label12.Text = "Avg Sum Ins. :";<br />
			// <br />
			// label13<br />
			// <br />
			this.label13.AutoSize = true;<br />
			this.label13.Location = new System.Drawing.Point(16, 56);<br />
			this.label13.Name = "label13";<br />
			this.label13.Size = new System.Drawing.Size(91, 16);<br />
			this.label13.TabIndex = 4;<br />
			this.label13.Text = "Max Free Cover :";<br />
			// <br />
			// label14<br />
			// <br />
			this.label14.AutoSize = true;<br />
			this.label14.Location = new System.Drawing.Point(112, 56);<br />
			this.label14.Name = "label14";<br />
			this.label14.Size = new System.Drawing.Size(77, 16);<br />
			this.label14.TabIndex = 5;<br />
			this.label14.Text = "Avg Sum Ins. :";<br />
			// <br />
			// label15<br />
			// <br />
			this.label15.AutoSize = true;<br />
			this.label15.Location = new System.Drawing.Point(112, 24);<br />
			this.label15.Name = "label15";<br />
			this.label15.Size = new System.Drawing.Size(77, 16);<br />
			this.label15.TabIndex = 6;<br />
			this.label15.Text = "Avg Sum Ins. :";<br />
			// <br />
			// label16<br />
			// <br />
			this.label16.AutoSize = true;<br />
			this.label16.Location = new System.Drawing.Point(112, 24);<br />
			this.label16.Name = "label16";<br />
			this.label16.Size = new System.Drawing.Size(77, 16);<br />
			this.label16.TabIndex = 6;<br />
			this.label16.Text = "Avg Sum Ins. :";<br />
			// <br />
			// label17<br />
			// <br />
			this.label17.AutoSize = true;<br />
			this.label17.Location = new System.Drawing.Point(112, 48);<br />
			this.label17.Name = "label17";<br />
			this.label17.Size = new System.Drawing.Size(77, 16);<br />
			this.label17.TabIndex = 7;<br />
			this.label17.Text = "Avg Sum Ins. :";<br />
			// <br />
			// label18<br />
			// <br />
			this.label18.AutoSize = true;<br />
			this.label18.Location = new System.Drawing.Point(112, 72);<br />
			this.label18.Name = "label18";<br />
			this.label18.Size = new System.Drawing.Size(77, 16);<br />
			this.label18.TabIndex = 8;<br />
			this.label18.Text = "Avg Sum Ins. :";<br />
			// <br />
			// label19<br />
			// <br />
			this.label19.AutoSize = true;<br />
			this.label19.Location = new System.Drawing.Point(112, 96);<br />
			this.label19.Name = "label19";<br />
			this.label19.Size = new System.Drawing.Size(77, 16);<br />
			this.label19.TabIndex = 9;<br />
			this.label19.Text = "Avg Sum Ins. :";<br />
			// <br />
			// label20<br />
			// <br />
			this.label20.AutoSize = true;<br />
			this.label20.Location = new System.Drawing.Point(128, 48);<br />
			this.label20.Name = "label20";<br />
			this.label20.Size = new System.Drawing.Size(77, 16);<br />
			this.label20.TabIndex = 7;<br />
			this.label20.Text = "Avg Sum Ins. :";<br />
			// <br />
			// label21<br />
			// <br />
			this.label21.AutoSize = true;<br />
			this.label21.Location = new System.Drawing.Point(128, 72);<br />
			this.label21.Name = "label21";<br />
			this.label21.Size = new System.Drawing.Size(77, 16);<br />
			this.label21.TabIndex = 8;<br />
			this.label21.Text = "Avg Sum Ins. :";<br />
			// <br />
			// label22<br />
			// <br />
			this.label22.AutoSize = true;<br />
			this.label22.Location = new System.Drawing.Point(128, 24);<br />
			this.label22.Name = "label22";<br />
			this.label22.Size = new System.Drawing.Size(77, 16);<br />
			this.label22.TabIndex = 9;<br />
			this.label22.Text = "Avg Sum Ins. :";<br />
			// <br />
			// label23<br />
			// <br />
			this.label23.AutoSize = true;<br />
			this.label23.Location = new System.Drawing.Point(128, 96);<br />
			this.label23.Name = "label23";<br />
			this.label23.Size = new System.Drawing.Size(77, 16);<br />
			this.label23.TabIndex = 10;<br />
			this.label23.Text = "Avg Sum Ins. :";<br />
			// <br />
			// label24<br />
			// <br />
			this.label24.AutoSize = true;<br />
			this.label24.Location = new System.Drawing.Point(128, 120);<br />
			this.label24.Name = "label24";<br />
			this.label24.Size = new System.Drawing.Size(77, 16);<br />
			this.label24.TabIndex = 11;<br />
			this.label24.Text = "Avg Sum Ins. :";<br />
			// <br />
			// label25<br />
			// <br />
			this.label25.AutoSize = true;<br />
			this.label25.Location = new System.Drawing.Point(128, 144);<br />
			this.label25.Name = "label25";<br />
			this.label25.Size = new System.Drawing.Size(77, 16);<br />
			this.label25.TabIndex = 12;<br />
			this.label25.Text = "Avg Sum Ins. :";<br />
			// <br />
			// label26<br />
			// <br />
			this.label26.AutoSize = true;<br />
			this.label26.Location = new System.Drawing.Point(128, 168);<br />
			this.label26.Name = "label26";<br />
			this.label26.Size = new System.Drawing.Size(77, 16);<br />
			this.label26.TabIndex = 13;<br />
			this.label26.Text = "Avg Sum Ins. :";<br />
			// <br />
			// groupBox1<br />
			// <br />
			this.groupBox1.Controls.Add(this.label33);<br />
			this.groupBox1.Controls.Add(this.label34);<br />
			this.groupBox1.Controls.Add(this.label31);<br />
			this.groupBox1.Controls.Add(this.label32);<br />
			this.groupBox1.Controls.Add(this.label29);<br />
			this.groupBox1.Controls.Add(this.label30);<br />
			this.groupBox1.Controls.Add(this.label27);<br />
			this.groupBox1.Controls.Add(this.label28);<br />
			this.groupBox1.Location = new System.Drawing.Point(352, 64);<br />
			this.groupBox1.Name = "groupBox1";<br />
			this.groupBox1.Size = new System.Drawing.Size(240, 208);<br />
			this.groupBox1.TabIndex = 2;<br />
			this.groupBox1.TabStop = false;<br />
			this.groupBox1.Text = " Total : ";<br />
			// <br />
			// label27<br />
			// <br />
			this.label27.AutoSize = true;<br />
			this.label27.Location = new System.Drawing.Point(120, 48);<br />
			this.label27.Name = "label27";<br />
			this.label27.Size = new System.Drawing.Size(77, 16);<br />
			this.label27.TabIndex = 11;<br />
			this.label27.Text = "Avg Sum Ins. :";<br />
			// <br />
			// label28<br />
			// <br />
			this.label28.AutoSize = true;<br />
			this.label28.Location = new System.Drawing.Point(16, 48);<br />
			this.label28.Name = "label28";<br />
			this.label28.Size = new System.Drawing.Size(48, 16);<br />
			this.label28.TabIndex = 10;<br />
			this.label28.Text = "Insured :";<br />
			// <br />
			// label29<br />
			// <br />
			this.label29.AutoSize = true;<br />
			this.label29.Location = new System.Drawing.Point(130, 84);<br />
			this.label29.Name = "label29";<br />
			this.label29.Size = new System.Drawing.Size(77, 16);<br />
			this.label29.TabIndex = 13;<br />
			this.label29.Text = "Avg Sum Ins. :";<br />
			// <br />
			// label30<br />
			// <br />
			this.label30.AutoSize = true;<br />
			this.label30.Location = new System.Drawing.Point(16, 80);<br />
			this.label30.Name = "label30";<br />
			this.label30.Size = new System.Drawing.Size(74, 16);<br />
			this.label30.TabIndex = 12;<br />
			this.label30.Text = "Sum Insured :";<br />
			// <br />
			// label31<br />
			// <br />
			this.label31.AutoSize = true;<br />
			this.label31.Location = new System.Drawing.Point(128, 120);<br />
			this.label31.Name = "label31";<br />
			this.label31.Size = new System.Drawing.Size(77, 16);<br />
			this.label31.TabIndex = 15;<br />
			this.label31.Text = "Avg Sum Ins. :";<br />
			// <br />
			// label32<br />
			// <br />
			this.label32.AutoSize = true;<br />
			this.label32.Location = new System.Drawing.Point(16, 112);<br />
			this.label32.Name = "label32";<br />
			this.label32.Size = new System.Drawing.Size(56, 16);<br />
			this.label32.TabIndex = 14;<br />
			this.label32.Text = "Premium :";<br />
			// <br />
			// label33<br />
			// <br />
			this.label33.AutoSize = true;<br />
			this.label33.Location = new System.Drawing.Point(128, 152);<br />
			this.label33.Name = "label33";<br />
			this.label33.Size = new System.Drawing.Size(77, 16);<br />
			this.label33.TabIndex = 17;<br />
			this.label33.Text = "Avg Sum Ins. :";<br />
			// <br />
			// label34<br />
			// <br />
			this.label34.AutoSize = true;<br />
			this.label34.Location = new System.Drawing.Point(16, 144);<br />
			this.label34.Name = "label34";<br />
			this.label34.Size = new System.Drawing.Size(70, 16);<br />
			this.label34.TabIndex = 16;<br />
			this.label34.Text = "Global Rate :";<br />
			// <br />
			// button1<br />
			// <br />
			this.button1.Location = new System.Drawing.Point(16, 304);<br />
			this.button1.Name = "button1";<br />
			this.button1.Size = new System.Drawing.Size(136, 23);<br />
			this.button1.TabIndex = 18;<br />
			this.button1.Text = "Age Distribution";<br />
			// <br />
			// button2<br />
			// <br />
			this.button2.Location = new System.Drawing.Point(168, 304);<br />
			this.button2.Name = "button2";<br />
			this.button2.Size = new System.Drawing.Size(136, 23);<br />
			this.button2.TabIndex = 19;<br />
			this.button2.Text = "Coverages";<br />
			// <br />
			// button3<br />
			// <br />
			this.button3.Location = new System.Drawing.Point(312, 304);<br />
			this.button3.Name = "button3";<br />
			this.button3.Size = new System.Drawing.Size(136, 23);<br />
			this.button3.TabIndex = 20;<br />
			this.button3.Text = "Loading";<br />
			// <br />
			// button4<br />
			// <br />
			this.button4.Location = new System.Drawing.Point(456, 304);<br />
			this.button4.Name = "button4";<br />
			this.button4.Size = new System.Drawing.Size(136, 23);<br />
			this.button4.TabIndex = 21;<br />
			this.button4.Text = "Passive War Add.";<br />
			// <br />
			// frmEziLife<br />
			// <br />
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);<br />
			this.ClientSize = new System.Drawing.Size(608, 347);<br />
			this.ControlBox = false;<br />
			this.Controls.Add(this.button4);<br />
			this.Controls.Add(this.button3);<br />
			this.Controls.Add(this.button2);<br />
			this.Controls.Add(this.groupBox1);<br />
			this.Controls.Add(this.tabControl1);<br />
			this.Controls.Add(this.lblName);<br />
			this.Controls.Add(this.button1);<br />
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;<br />
			this.MaximizeBox = false;<br />
			this.Menu = this.mnuEziLife;<br />
			this.MinimizeBox = false;<br />
			this.Name = "frmEziLife";<br />
			this.ShowInTaskbar = false;<br />
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;<br />
			this.Text = "MedGulf - Ezi-Life";<br />
			this.tabControl1.ResumeLayout(false);<br />
			this.tabGL.ResumeLayout(false);<br />
			this.tabPA.ResumeLayout(false);<br />
			this.tabTreaty.ResumeLayout(false);<br />
			this.groupBox1.ResumeLayout(false);<br />
			this.ResumeLayout(false);<br />
<br />
		}<br />
		#endregion<br />
<br />
		public void yahaa()<br />
		{<br />
			this.Text = "TEST";<br />
			this.lblName.Text = "TEST";<br />
			lblName.Refresh();<br />
			MessageBox.Show("Yahaa!!", "STOP!!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);<br />
			this.lblName.Text = "TEST";<br />
		}<br />
<br />
		private void mnuClose_Click(object sender, System.EventArgs e)<br />
		{<br />
			this.Close();<br />
		}<br />
<br />
		private void mnuNew_Click(object sender, System.EventArgs e)<br />
		{<br />
			NewEziForm.ShowDialog();<br />
		}<br />
	}<br />
}<br />


and this is Form_B where I am calling the method..


using System;<br />
using System.Drawing;<br />
using System.Collections;<br />
using System.ComponentModel;<br />
using System.Windows.Forms;<br />
using VistaDB;<br />
<br />
namespace Ezi_Work<br />
{<br />
	/// <summary><br />
	/// Summary description for ezi_life_new_form.<br />
	/// </summary><br />
	public class frmEziLife_New : System.Windows.Forms.Form<br />
	{<br />
		// Database;<br />
		VistaDBDatabase eziDatabase = new VistaDBDatabase();<br />
		VistaDBTable proposalTable = new VistaDBTable();<br />
<br />
		private System.Windows.Forms.CheckBox chkRemarks;<br />
		private System.Windows.Forms.TextBox txtRemarks;<br />
		private System.Windows.Forms.Button btnCancel;<br />
		private System.Windows.Forms.Button btnCreate;<br />
		private System.Windows.Forms.Label label3;<br />
		private System.Windows.Forms.Label label1;<br />
		private System.Windows.Forms.CheckBox chkPolicyRenewal;<br />
		private System.Windows.Forms.CheckBox chkPassiveWar;<br />
		private System.Windows.Forms.TextBox txtHighestSumInsured;<br />
		private System.Windows.Forms.TextBox txtEziName;<br />
		/// <summary><br />
		/// Required designer variable.<br />
		/// </summary><br />
		private System.ComponentModel.Container components = null;<br />
<br />
		public frmEziLife_New()<br />
		{<br />
			//<br />
			// Required for Windows Form Designer support<br />
			//<br />
			InitializeComponent();<br />
<br />
			//<br />
			// TODO: Add any constructor code after InitializeComponent call<br />
			//<br />
		}<br />
<br />
		/// <summary><br />
		/// Clean up any resources being used.<br />
		/// </summary><br />
		protected override void Dispose( bool disposing )<br />
		{<br />
			if( disposing )<br />
			{<br />
				if(components != null)<br />
				{<br />
					components.Dispose();<br />
				}<br />
			}<br />
			base.Dispose( disposing );<br />
		}<br />
<br />
		#region Windows Form Designer generated code<br />
		/// <summary><br />
		/// Required method for Designer support - do not modify<br />
		/// the contents of this method with the code editor.<br />
		/// </summary><br />
		private void InitializeComponent()<br />
		{<br />
			this.chkRemarks = new System.Windows.Forms.CheckBox();<br />
			this.txtRemarks = new System.Windows.Forms.TextBox();<br />
			this.btnCancel = new System.Windows.Forms.Button();<br />
			this.btnCreate = new System.Windows.Forms.Button();<br />
			this.label3 = new System.Windows.Forms.Label();<br />
			this.label1 = new System.Windows.Forms.Label();<br />
			this.chkPolicyRenewal = new System.Windows.Forms.CheckBox();<br />
			this.chkPassiveWar = new System.Windows.Forms.CheckBox();<br />
			this.txtHighestSumInsured = new System.Windows.Forms.TextBox();<br />
			this.txtEziName = new System.Windows.Forms.TextBox();<br />
			this.SuspendLayout();<br />
			// <br />
			// chkRemarks<br />
			// <br />
			this.chkRemarks.Location = new System.Drawing.Point(320, 24);<br />
			this.chkRemarks.Name = "chkRemarks";<br />
			this.chkRemarks.Size = new System.Drawing.Size(80, 24);<br />
			this.chkRemarks.TabIndex = 19;<br />
			this.chkRemarks.Text = "Remarks :";<br />
			this.chkRemarks.TextAlign = System.Drawing.ContentAlignment.MiddleRight;<br />
			this.chkRemarks.CheckedChanged += new System.EventHandler(this.chkRemarks_CheckedChanged);<br />
			// <br />
			// txtRemarks<br />
			// <br />
			this.txtRemarks.Location = new System.Drawing.Point(24, 208);<br />
			this.txtRemarks.Multiline = true;<br />
			this.txtRemarks.Name = "txtRemarks";<br />
			this.txtRemarks.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;<br />
			this.txtRemarks.Size = new System.Drawing.Size(368, 88);<br />
			this.txtRemarks.TabIndex = 17;<br />
			this.txtRemarks.Text = "";<br />
			// <br />
			// btnCancel<br />
			// <br />
			this.btnCancel.Location = new System.Drawing.Point(320, 160);<br />
			this.btnCancel.Name = "btnCancel";<br />
			this.btnCancel.TabIndex = 16;<br />
			this.btnCancel.Text = "Cancel";<br />
			this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);<br />
			// <br />
			// btnCreate<br />
			// <br />
			this.btnCreate.Location = new System.Drawing.Point(240, 160);<br />
			this.btnCreate.Name = "btnCreate";<br />
			this.btnCreate.TabIndex = 15;<br />
			this.btnCreate.Text = "Create";<br />
			this.btnCreate.Click += new System.EventHandler(this.btnCreate_Click);<br />
			// <br />
			// label3<br />
			// <br />
			this.label3.AutoSize = true;<br />
			this.label3.Location = new System.Drawing.Point(176, 104);<br />
			this.label3.Name = "label3";<br />
			this.label3.Size = new System.Drawing.Size(116, 16);<br />
			this.label3.TabIndex = 18;<br />
			this.label3.Text = "Highest Sum Insured :";<br />
			// <br />
			// label1<br />
			// <br />
			this.label1.AutoSize = true;<br />
			this.label1.Location = new System.Drawing.Point(24, 32);<br />
			this.label1.Name = "label1";<br />
			this.label1.Size = new System.Drawing.Size(71, 16);<br />
			this.label1.TabIndex = 14;<br />
			this.label1.Text = "Enter Name :";<br />
			// <br />
			// chkPolicyRenewal<br />
			// <br />
			this.chkPolicyRenewal.Location = new System.Drawing.Point(24, 160);<br />
			this.chkPolicyRenewal.Name = "chkPolicyRenewal";<br />
			this.chkPolicyRenewal.TabIndex = 13;<br />
			this.chkPolicyRenewal.Text = "Policy Renewal";<br />
			// <br />
			// chkPassiveWar<br />
			// <br />
			this.chkPassiveWar.Location = new System.Drawing.Point(24, 96);<br />
			this.chkPassiveWar.Name = "chkPassiveWar";<br />
			this.chkPassiveWar.Size = new System.Drawing.Size(128, 24);<br />
			this.chkPassiveWar.TabIndex = 11;<br />
			this.chkPassiveWar.Text = "Passive War Add.";<br />
			// <br />
			// txtHighestSumInsured<br />
			// <br />
			this.txtHighestSumInsured.Location = new System.Drawing.Point(296, 96);<br />
			this.txtHighestSumInsured.Name = "txtHighestSumInsured";<br />
			this.txtHighestSumInsured.Size = new System.Drawing.Size(96, 20);<br />
			this.txtHighestSumInsured.TabIndex = 12;<br />
			this.txtHighestSumInsured.Text = "280000";<br />
			this.txtHighestSumInsured.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;<br />
			// <br />
			// txtEziName<br />
			// <br />
			this.txtEziName.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;<br />
			this.txtEziName.Location = new System.Drawing.Point(24, 56);<br />
			this.txtEziName.MaxLength = 15;<br />
			this.txtEziName.Name = "txtEziName";<br />
			this.txtEziName.Size = new System.Drawing.Size(376, 20);<br />
			this.txtEziName.TabIndex = 10;<br />
			this.txtEziName.Text = "";<br />
			// <br />
			// frmEziLife_New<br />
			// <br />
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);<br />
			this.ClientSize = new System.Drawing.Size(418, 200);<br />
			this.ControlBox = false;<br />
			this.Controls.Add(this.chkRemarks);<br />
			this.Controls.Add(this.txtRemarks);<br />
			this.Controls.Add(this.btnCancel);<br />
			this.Controls.Add(this.btnCreate);<br />
			this.Controls.Add(this.label3);<br />
			this.Controls.Add(this.label1);<br />
			this.Controls.Add(this.chkPolicyRenewal);<br />
			this.Controls.Add(this.chkPassiveWar);<br />
			this.Controls.Add(this.txtHighestSumInsured);<br />
			this.Controls.Add(this.txtEziName);<br />
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;<br />
			this.MaximizeBox = false;<br />
			this.MinimizeBox = false;<br />
			this.Name = "frmEziLife_New";<br />
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;<br />
			this.Text = "ezi_life_new_form";<br />
			this.ResumeLayout(false);<br />
<br />
		}<br />
		#endregion<br />
<br />
		private void chkRemarks_CheckedChanged(object sender, System.EventArgs e)<br />
		{<br />
			if (chkRemarks.Checked == true)<br />
			{<br />
				this.Height = 352;<br />
				txtRemarks.Focus();<br />
			}<br />
			else<br />
				this.Height = 232;<br />
		}<br />
<br />
		private void btnCancel_Click(object sender, System.EventArgs e)<br />
		{<br />
			this.Close();<br />
		}<br />
<br />
		private void btnCreate_Click(object sender, System.EventArgs e)<br />
		{<br />
			// connect to the database;<br />
			eziDatabase.DatabaseName = "C:\\Documents and Settings\\Jassim Rahma\\My Documents\\Visual Studio Projects\\Ezi-Life\\Database\\EziLife.vdb";<br />
			eziDatabase.Parameters = 0;<br />
			eziDatabase.Exclusive = true;<br />
			eziDatabase.Connect();<br />
			<br />
			// open tables<br />
			proposalTable.Database = eziDatabase;<br />
			proposalTable.TableName = "EZI_PROPOSALS";<br />
			proposalTable.Open();<br />
<br />
			if (proposalTable.Find("EZI_NAME:'" + txtEziName.Text.Trim() + "'", "idx_name"))<br />
			{<br />
				MessageBox.Show("Proposal Name already exist.", "Error!!", MessageBoxButtons.OK, MessageBoxIcon.Error);<br />
				txtEziName.Focus();<br />
			}<br />
			else<br />
			{<br />
				// add new proposal;<br />
				proposalTable.Insert();<br />
				proposalTable.PutString("EZI_NAME", txtEziName.Text.Trim());<br />
				proposalTable.PutDouble("HIGHEST_SUM_INSURED", Convert.ToDouble(txtHighestSumInsured.Text));<br />
				if (chkPassiveWar.Checked == true)<br />
					proposalTable.PutString("PASSIVE_WAR", "Y");<br />
				else<br />
					proposalTable.PutString("PASSIVE_WAR", "N");<br />
				if (chkPolicyRenewal.Checked == true)<br />
					proposalTable.PutString("POLICY_RENEWAL", "Y");<br />
				else<br />
					proposalTable.PutString("POLICY_RENEWAL", "N");<br />
				proposalTable.PutDouble("EZI_LOADING", 0);<br />
				proposalTable.PutMemo("EZI_REMARKS", txtRemarks.Text);<br />
				proposalTable.PutString("CREATED_BY_USER", System.Environment.UserName);<br />
				// proposalTable.PutString("CREATED_BY_IP", addr[0].ToString());<br />
				proposalTable.PutString("CREATED_BY_COMPUTER", System.Environment.MachineName);<br />
				proposalTable.PutDateTime("CREATED_BY_DATE", DateTime.Now);<br />
				proposalTable.Post();<br />
<br />
				frmEziLife EziLifeForm = new frmEziLife();<br />
				EziLifeForm.new_record_id = proposalTable.GetInt32("EZI_ID");<br />
				EziLifeForm.yahaa();<br />
<br />
				this.Close();<br />
			}<br />
<br />
			//Close table<br />
			proposalTable.Close();<br />
			//Close database<br />
			eziDatabase.Close();<br />
		}<br />
	}<br />
}<br />


Jassim Rahma
GeneralRe: c# procedure Pin
Dave Kreskowiak27-Aug-05 8:16
mveDave Kreskowiak27-Aug-05 8:16 
GeneralRe: c# procedure Pin
Jassim Rahma27-Aug-05 8:44
Jassim Rahma27-Aug-05 8:44 
GeneralRe: c# procedure Pin
Dave Kreskowiak28-Aug-05 3:18
mveDave Kreskowiak28-Aug-05 3:18 
GeneralRe: c# procedure Pin
Jassim Rahma28-Aug-05 8:30
Jassim Rahma28-Aug-05 8:30 
GeneralRe: c# procedure Pin
Dave Kreskowiak28-Aug-05 9:36
mveDave Kreskowiak28-Aug-05 9:36 
GeneralRe: c# procedure Pin
Jassim Rahma28-Aug-05 9:48
Jassim Rahma28-Aug-05 9:48 
GeneralRe: c# procedure Pin
Dave Kreskowiak29-Aug-05 1:24
mveDave Kreskowiak29-Aug-05 1:24 
QuestionScrolling TreeView without scrollbars shown. Pin
Blazej Stompel26-Aug-05 9:44
Blazej Stompel26-Aug-05 9:44 
AnswerRe: Scrolling TreeView without scrollbars shown. Pin
Dave Kreskowiak26-Aug-05 14:17
mveDave Kreskowiak26-Aug-05 14:17 
QuestionMSDE 2000 over network Pin
Anonymous26-Aug-05 9:27
Anonymous26-Aug-05 9:27 
AnswerI'm not really anonymous Pin
theStorminMormon26-Aug-05 9:30
theStorminMormon26-Aug-05 9:30 
GeneralRe: I'm not really anonymous Pin
Alomgir Miah26-Aug-05 18:23
Alomgir Miah26-Aug-05 18:23 
QuestionCircle Image Pin
nc3b26-Aug-05 9:18
nc3b26-Aug-05 9:18 
QuestionForce user to submit excel file Pin
t2126-Aug-05 8:00
t2126-Aug-05 8:00 
AnswerRe: Force user to submit excel file Pin
Daniel Turini26-Aug-05 9:04
Daniel Turini26-Aug-05 9:04 
GeneralRe: Force user to submit excel file Pin
t2126-Aug-05 11:15
t2126-Aug-05 11:15 
GeneralRe: Force user to submit excel file Pin
Daniel Turini26-Aug-05 15:27
Daniel Turini26-Aug-05 15:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.