Highclonoid Softec c# tutorials
Friday 22 April 2016
Tuesday 19 April 2016
Customizing Windows Form in c#
Customizing Windows Form in c#
Code for customizing Form is given below
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace blog_programs
{
public partial class customizng_a_window_form : Form
{
public customizng_a_window_form()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
this.FormBorderStyle = FormBorderStyle.FixedDialog;
}
private void button2_Click(object sender, EventArgs e)
{
this.Size = new Size(300, 500);
}
private void button3_Click(object sender, EventArgs e)
{
this.Opacity = 0.5;
}
}
}
Results:
The above Sreenshot is for form border style
The above screenshot is for resize
The above Screenshot is for opacity
Tutorial From highclonoidsoftec.com
Saturday 16 April 2016
Non rectangular Form @ highclonoidsoftec.com
Non rectangular Form Development in C#.net
The given below code is for creating a non rectangular form.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace blog_programs
{
public partial class non_rectangular_form : Form
{
System.Drawing.Drawing2D.GraphicsPath mypath = new System.Drawing.Drawing2D.GraphicsPath();
The code in orange background is the class which is used.
Which has the function which support the code given below
public non_rectangular_form()
{
InitializeComponent();
}
private void non_rectangular_form_Load(object sender, EventArgs e)
{
mypath.AddEllipse(0, 0, this.Width, this.Height);
Region myregion = new Region(mypath);
this.Region = myregion;
}
}
}
The given below code is for creating a non rectangular form.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace blog_programs
{
public partial class non_rectangular_form : Form
{
System.Drawing.Drawing2D.GraphicsPath mypath = new System.Drawing.Drawing2D.GraphicsPath();
The code in orange background is the class which is used.
Which has the function which support the code given below
public non_rectangular_form()
{
InitializeComponent();
}
private void non_rectangular_form_Load(object sender, EventArgs e)
{
mypath.AddEllipse(0, 0, this.Width, this.Height);
Region myregion = new Region(mypath);
this.Region = myregion;
}
}
}
Friday 9 October 2015
North West Corner Method in c#
private void button1_Click(object sender, EventArgs e)
{
try
{
DEMAND_1();
DEMAND_2();
DEMAND_3();
DEMAND_4();
total_transport();
}
catch(Exception ee)
{
MessageBox.Show(ee + "");
}
}
public void DEMAND_1()
{
try
{
int supp_1 = Convert.ToInt32(txt_supply_1.Text);
int supp_2 = Convert.ToInt32(txt_supply_2.Text);
int supp_3 = Convert.ToInt32(txt_supply_3.Text);
int dem_1 = Convert.ToInt32(txt_demand_1.Text);
int dem_2 = Convert.ToInt32(txt_demand_2.Text);
int dem_3 = Convert.ToInt32(txt_demand_3.Text);
int dem_4 = Convert.ToInt32(txt_demand_4.Text);
if (dem_1 != 0)
{
if (dem_1 >= supp_1)
{
if (supp_1 != 0)
{
int d1_d1_inte = Convert.ToInt32(lbl_d1_d1.Text.ToString());
if (d1_d1_inte == 0)
{
//int res_1=dem_1 - supp_1;
lbl_d1_d1.Text = supp_1 + "";
txt_demand_1.Text = dem_1 - supp_1 + "";
txt_supply_1.Text = "0";
}
}
}
}
if (dem_1 != 0)
{
if (supp_1 >= dem_1)
{
if (dem_1 != 0)
{
int d1_d1_inte = Convert.ToInt32(lbl_d1_d1.Text.ToString());
if (d1_d1_inte == 0)
{
//int res_1=dem_1 - supp_1;
lbl_d1_d1.Text = dem_1 + "";
txt_supply_1.Text = supp_1 - dem_1 + "";
txt_demand_1.Text = "0";
}
}
}
}
int supp_11 = Convert.ToInt32(txt_supply_1.Text);
int supp_21 = Convert.ToInt32(txt_supply_2.Text);
int supp_31 = Convert.ToInt32(txt_supply_3.Text);
int dem_11 = Convert.ToInt32(txt_demand_1.Text);
int dem_21 = Convert.ToInt32(txt_demand_2.Text);
int dem_31 = Convert.ToInt32(txt_demand_3.Text);
int dem_41 = Convert.ToInt32(txt_demand_4.Text);
if (dem_11 != 0)
{
if (supp_21 != 0)
{
if (dem_11 >= supp_21)
{
if (supp_21 != 01)
{
int d2_d1_inte = Convert.ToInt32(lbl_d2_d1.Text.ToString());
if (d2_d1_inte == 0)
{
lbl_d2_d1.Text = supp_21 + "";
txt_supply_2.Text = "0";
txt_demand_1.Text = dem_1 - supp_21 + "";
}
}
}
}
}
if (dem_11 != 0)
{
if (supp_21 >= dem_11)
{
if (dem_11 != 0)
{
int d2_d1_inte = Convert.ToInt32(lbl_d2_d1.Text.ToString());
if (d2_d1_inte == 0)
{
lbl_d2_d1.Text = dem_11 + "";
txt_demand_1.Text = "0";
txt_supply_2.Text = supp_21 - dem_11 + "";
}
}
}
}
int supp_111 = Convert.ToInt32(txt_supply_1.Text);
int supp_211 = Convert.ToInt32(txt_supply_2.Text);
int supp_311 = Convert.ToInt32(txt_supply_3.Text);
int dem_111 = Convert.ToInt32(txt_demand_1.Text);
int dem_211 = Convert.ToInt32(txt_demand_2.Text);
int dem_311 = Convert.ToInt32(txt_demand_3.Text);
int dem_411 = Convert.ToInt32(txt_demand_4.Text);
if (dem_111 != 0)
{
if (supp_311 != 0)
{
if (dem_111 >= supp_311)
{
if (supp_311 != 0)
{
int d3_d1_inte = Convert.ToInt32(lbl_d3_d1.Text.ToString());
if (d3_d1_inte == 0)
{
lbl_d3_d1.Text = supp_3 + "";
txt_supply_3.Text = "0";
txt_demand_1.Text = dem_111 - supp_311 + "";
}
}
}
}
}
if (dem_111 != 0)
{
if (supp_311 >= dem_111)
{
if (dem_111 != 0)
{
int d3_d1_inte = Convert.ToInt32(lbl_d3_d1.Text.ToString());
if (d3_d1_inte == 0)
{
lbl_d3_d1.Text = supp_311 + "";
txt_demand_1.Text = "0";
txt_supply_3.Text = supp_311 - dem_111 + "";
}
}
}
}
/*----------------------------------------------------------------------------------------------*/
}
catch (Exception ee)
{
MessageBox.Show(ee + "");
}
}
public void DEMAND_2()
{
try
{
int supp_1 = Convert.ToInt32(txt_supply_1.Text);
int supp_2 = Convert.ToInt32(txt_supply_2.Text);
int supp_3 = Convert.ToInt32(txt_supply_3.Text);
int dem_1 = Convert.ToInt32(txt_demand_1.Text);
int dem_2 = Convert.ToInt32(txt_demand_2.Text);
int dem_3 = Convert.ToInt32(txt_demand_3.Text);
int dem_4 = Convert.ToInt32(txt_demand_4.Text);
if (dem_2 != 0)
{
if (dem_2 >= supp_1)
{
if (supp_1 != 0)
{
int d1_d2_inte = Convert.ToInt32(lbl_d1_d2.Text.ToString());
if (d1_d2_inte == 0)
{
//int res_1=dem_1 - supp_1;
lbl_d1_d2.Text = supp_1 + "";
txt_demand_2.Text = dem_2 - supp_1 + "";
txt_supply_1.Text = "0";
}
}
}
}
if (dem_2 != 0)
{
if (supp_1 >= dem_2)
{
if (dem_2 != 0)
{
int d1_d2_inte = Convert.ToInt32(lbl_d1_d2.Text.ToString());
if (d1_d2_inte == 0)
{
//int res_1=dem_1 - supp_1;
lbl_d1_d2.Text = dem_2 + "";
txt_supply_1.Text = supp_1 - dem_2 + "";
txt_demand_2.Text = "0";
}
}
}
}
int supp_11 = Convert.ToInt32(txt_supply_1.Text);
int supp_21 = Convert.ToInt32(txt_supply_2.Text);
int supp_31 = Convert.ToInt32(txt_supply_3.Text);
int dem_11 = Convert.ToInt32(txt_demand_1.Text);
int dem_21 = Convert.ToInt32(txt_demand_2.Text);
int dem_31 = Convert.ToInt32(txt_demand_3.Text);
int dem_41 = Convert.ToInt32(txt_demand_4.Text);
if (dem_21 != 0)
{
if (supp_21 != 0)
{
if (dem_21 >= supp_21)
{
if (supp_21 != 01)
{
int d2_d2_inte = Convert.ToInt32(lbl_d2_d2.Text.ToString());
if (d2_d2_inte == 0)
{
lbl_d2_d2.Text = supp_21 + "";
txt_supply_2.Text = "0";
txt_demand_2.Text = dem_21 - supp_21 + "";
}
}
}
}
}
if (dem_21 != 0)
{
if (supp_21 >= dem_21)
{
if (dem_21 != 0)
{
int d2_d2_inte = Convert.ToInt32(lbl_d2_d2.Text.ToString());
if (d2_d2_inte == 0)
{
lbl_d2_d2.Text = dem_21 + "";
txt_demand_2.Text = "0";
txt_supply_2.Text = supp_21 - dem_21 + "";
}
}
}
}
int supp_111 = Convert.ToInt32(txt_supply_1.Text);
int supp_211 = Convert.ToInt32(txt_supply_2.Text);
int supp_311 = Convert.ToInt32(txt_supply_3.Text);
int dem_111 = Convert.ToInt32(txt_demand_1.Text);
int dem_211 = Convert.ToInt32(txt_demand_2.Text);
int dem_311 = Convert.ToInt32(txt_demand_3.Text);
int dem_411 = Convert.ToInt32(txt_demand_4.Text);
if (dem_111 != 0)
{
if (supp_311 != 0)
{
if (dem_211 >= supp_311)
{
if (supp_311 != 0)
{
int d3_d2_inte = Convert.ToInt32(lbl_d3_d2.Text.ToString());
if (d3_d2_inte == 0)
{
lbl_d3_d2.Text = supp_3 + "";
txt_supply_3.Text = "0";
txt_demand_2.Text = dem_211 - supp_311 + "";
}
}
}
}
}
if (dem_211 != 0)
{
if (supp_311 >= dem_211)
{
if (dem_211 != 0)
{
int d3_d1_inte = Convert.ToInt32(lbl_d3_d2.Text.ToString());
if (d3_d1_inte == 0)
{
lbl_d3_d2.Text = supp_311 + "";
txt_demand_2.Text = "0";
txt_supply_3.Text = supp_311 - dem_211 + "";
}
}
}
}
/*----------------------------------------------------------------------------------------------*/
}
catch (Exception ee)
{
MessageBox.Show(ee + "");
}
}
public void DEMAND_3()
{
try
{
int supp_1 = Convert.ToInt32(txt_supply_1.Text);
int supp_2 = Convert.ToInt32(txt_supply_2.Text);
int supp_3 = Convert.ToInt32(txt_supply_3.Text);
int dem_1 = Convert.ToInt32(txt_demand_1.Text);
int dem_2 = Convert.ToInt32(txt_demand_2.Text);
int dem_3 = Convert.ToInt32(txt_demand_3.Text);
int dem_4 = Convert.ToInt32(txt_demand_4.Text);
if (dem_3 != 0)
{
if (dem_3 >= supp_1)
{
if (supp_1 != 0)
{
int d1_d3_inte = Convert.ToInt32(lbl_d1_d3.Text.ToString());
if (d1_d3_inte == 0)
{
//int res_1=dem_1 - supp_1;
lbl_d1_d3.Text = supp_1 + "";
txt_demand_3.Text = dem_3 - supp_1 + "";
txt_supply_1.Text = "0";
}
}
}
}
if (dem_3 != 0)
{
if (supp_1 >= dem_3)
{
if (dem_3 != 0)
{
int d1_d3_inte = Convert.ToInt32(lbl_d1_d3.Text.ToString());
if (d1_d3_inte == 0)
{
//int res_1=dem_1 - supp_1;
lbl_d1_d3.Text = dem_3 + "";
txt_supply_1.Text = supp_1 - dem_3 + "";
txt_demand_3.Text = "0";
}
}
}
}
int supp_11 = Convert.ToInt32(txt_supply_1.Text);
int supp_21 = Convert.ToInt32(txt_supply_2.Text);
int supp_31 = Convert.ToInt32(txt_supply_3.Text);
int dem_11 = Convert.ToInt32(txt_demand_1.Text);
int dem_21 = Convert.ToInt32(txt_demand_2.Text);
int dem_31 = Convert.ToInt32(txt_demand_3.Text);
int dem_41 = Convert.ToInt32(txt_demand_4.Text);
if (dem_11 != 0)
{
if (supp_31 != 0)
{
if (dem_31 >= supp_21)
{
if (supp_21 != 01)
{
int d2_d3_inte = Convert.ToInt32(lbl_d2_d3.Text.ToString());
if (d2_d3_inte == 0)
{
lbl_d2_d3.Text = supp_21 + "";
txt_supply_2.Text = "0";
txt_demand_3.Text = dem_31 - supp_21 + "";
}
}
}
}
}
if (dem_31 != 0)
{
if (supp_21 >= dem_31)
{
if (dem_31 != 0)
{
int d2_d3_inte = Convert.ToInt32(lbl_d2_d3.Text.ToString());
if (d2_d3_inte == 0)
{
lbl_d2_d3.Text = dem_31 + "";
txt_demand_3.Text = "0";
txt_supply_2.Text = supp_21 - dem_31 + "";
}
}
}
}
int supp_111 = Convert.ToInt32(txt_supply_1.Text);
int supp_211 = Convert.ToInt32(txt_supply_2.Text);
int supp_311 = Convert.ToInt32(txt_supply_3.Text);
int dem_111 = Convert.ToInt32(txt_demand_1.Text);
int dem_211 = Convert.ToInt32(txt_demand_2.Text);
int dem_311 = Convert.ToInt32(txt_demand_3.Text);
int dem_411 = Convert.ToInt32(txt_demand_4.Text);
if (dem_311 != 0)
{
if (supp_311 != 0)
{
if (dem_311 >= supp_311)
{
if (supp_311 != 0)
{
int d3_d3_inte = Convert.ToInt32(lbl_d3_d3.Text.ToString());
if (d3_d3_inte == 0)
{
lbl_d3_d3.Text = supp_311 + "";
txt_supply_3.Text = "0";
txt_demand_3.Text = dem_311 - supp_311 + "";
}
}
}
}
}
if (dem_311 != 0)
{
if (supp_311 >= dem_111)
{
if (dem_111 != 0)
{
int d3_d3_inte = Convert.ToInt32(lbl_d3_d3.Text.ToString());
if (d3_d3_inte == 0)
{
lbl_d3_d3.Text = supp_311 + "";
txt_demand_3.Text = "0";
txt_supply_3.Text = supp_311 - dem_311 + "";
}
}
}
}
/*----------------------------------------------------------------------------------------------*/
}
catch (Exception ee)
{
MessageBox.Show(ee + "");
}
}
public void DEMAND_4()
{
try
{
int supp_1 = Convert.ToInt32(txt_supply_1.Text);
int supp_2 = Convert.ToInt32(txt_supply_2.Text);
int supp_3 = Convert.ToInt32(txt_supply_3.Text);
int dem_1 = Convert.ToInt32(txt_demand_1.Text);
int dem_2 = Convert.ToInt32(txt_demand_2.Text);
int dem_3 = Convert.ToInt32(txt_demand_3.Text);
int dem_4 = Convert.ToInt32(txt_demand_4.Text);
if (dem_4 != 0)
{
if (dem_4 >= supp_1)
{
if (supp_1 != 0)
{
int d1_d4_inte = Convert.ToInt32(lbl_d1_d4.Text.ToString());
if (d1_d4_inte == 0)
{
//int res_1=dem_1 - supp_1;
lbl_d1_d4.Text = supp_1 + "";
txt_demand_4.Text = dem_4 - supp_1 + "";
txt_supply_1.Text = "0";
}
}
}
}
if (dem_4 != 0)
{
if (supp_1 >= dem_4)
{
if (dem_4 != 0)
{
int d1_d4_inte = Convert.ToInt32(lbl_d1_d4.Text.ToString());
if (d1_d4_inte == 0)
{
//int res_1=dem_1 - supp_1;
lbl_d1_d4.Text = dem_4 + "";
txt_supply_1.Text = supp_1 - dem_4 + "";
txt_demand_4.Text = "0";
}
}
}
}
int supp_11 = Convert.ToInt32(txt_supply_1.Text);
int supp_21 = Convert.ToInt32(txt_supply_2.Text);
int supp_31 = Convert.ToInt32(txt_supply_3.Text);
int dem_11 = Convert.ToInt32(txt_demand_1.Text);
int dem_21 = Convert.ToInt32(txt_demand_2.Text);
int dem_31 = Convert.ToInt32(txt_demand_3.Text);
int dem_41 = Convert.ToInt32(txt_demand_4.Text);
if (dem_41 != 0)
{
if (supp_21 != 0)
{
if (dem_41 >= supp_21)
{
if (supp_21 != 01)
{
int d2_d4_inte = Convert.ToInt32(lbl_d2_d4.Text.ToString());
if (d2_d4_inte == 0)
{
lbl_d2_d4.Text = supp_21 + "";
txt_supply_2.Text = "0";
txt_demand_4.Text = dem_41 - supp_21 + "";
}
}
}
}
}
if (dem_41 != 0)
{
if (supp_21 >= dem_41)
{
if (dem_41 != 0)
{
int d2_d4_inte = Convert.ToInt32(lbl_d2_d4.Text.ToString());
if (d2_d4_inte == 0)
{
lbl_d2_d4.Text = dem_41 + "";
txt_demand_4.Text = "0";
txt_supply_2.Text = supp_21 - dem_41 + "";
}
}
}
}
int supp_111 = Convert.ToInt32(txt_supply_1.Text);
int supp_211 = Convert.ToInt32(txt_supply_2.Text);
int supp_311 = Convert.ToInt32(txt_supply_3.Text);
int dem_111 = Convert.ToInt32(txt_demand_1.Text);
int dem_211 = Convert.ToInt32(txt_demand_2.Text);
int dem_311 = Convert.ToInt32(txt_demand_3.Text);
int dem_411 = Convert.ToInt32(txt_demand_4.Text);
if (dem_411 != 0)
{
if (supp_311 != 0)
{
if (dem_411 >= supp_311)
{
if (supp_311 != 0)
{
int d3_d4_inte = Convert.ToInt32(lbl_d3_d4.Text.ToString());
if (d3_d4_inte == 0)
{
lbl_d3_d4.Text = supp_311 + "";
txt_supply_3.Text = "0";
txt_demand_4.Text = dem_411 - supp_311 + "";
}
}
}
}
}
if (dem_411 != 0)
{
if (supp_311 >= dem_411)
{
if (dem_411 != 0)
{
int d3_d4_inte = Convert.ToInt32(lbl_d3_d4.Text.ToString());
if (d3_d4_inte == 0)
{
lbl_d3_d4.Text = supp_311 + "";
txt_demand_4.Text = "0";
txt_supply_3.Text = supp_311 - dem_411 + "";
}
}
}
}
/*----------------------------------------------------------------------------------------------*/
}
catch (Exception ee)
{
MessageBox.Show(ee + "");
}
}
public void total_transport()
{
int txt1 = Convert.ToInt32(txt_d1_d1.Text);
int txt2 = Convert.ToInt32(txt_d1_d2.Text);
int txt3 = Convert.ToInt32(txt_d1_d3.Text);
int txt4 = Convert.ToInt32(txt_d1_d4.Text);
int txt5 = Convert.ToInt32(txt_d2_d1.Text);
int txt6 = Convert.ToInt32(txt_d2_d2.Text);
int txt7 = Convert.ToInt32(txt_d2_d3.Text);
int txt8 = Convert.ToInt32(txt_d2_d4.Text);
int txt9 = Convert.ToInt32(txt_d3_d1.Text);
int txt10 = Convert.ToInt32(txt_d3_d2.Text);
int txt11 = Convert.ToInt32(txt_d3_d3.Text);
int txt12 = Convert.ToInt32(txt_d3_d4.Text);
int lbl_1 = Convert.ToInt32(lbl_d1_d1.Text);
int lbl_2 = Convert.ToInt32(lbl_d1_d2.Text);
int lbl_3 = Convert.ToInt32(lbl_d1_d3.Text);
int lbl_4 = Convert.ToInt32(lbl_d1_d4.Text);
int lbl_5 = Convert.ToInt32(lbl_d2_d1.Text);
int lbl_6 = Convert.ToInt32(lbl_d2_d2.Text);
int lbl_7 = Convert.ToInt32(lbl_d2_d3.Text);
int lbl_8 = Convert.ToInt32(lbl_d2_d4.Text);
int lbl_9 = Convert.ToInt32(lbl_d3_d1.Text);
int lbl_10 = Convert.ToInt32(lbl_d3_d2.Text);
int lbl_11 = Convert.ToInt32(lbl_d3_d3.Text);
int lbl_12 = Convert.ToInt32(lbl_d3_d4.Text);
lbltransport.Text=txt1*lbl_1+txt2*lbl_2+txt3*lbl_3+txt4*lbl_4+txt5*lbl_5+txt6*lbl_6+txt7*lbl_7+txt8*lbl_8+txt9*lbl_9+txt10*lbl_10+txt11*lbl_11+txt12*lbl_12+"";
}
private void lbl_supply_total_Click(object sender, EventArgs e)
{
}
private void txt_supply_1_TextChanged(object sender, EventArgs e)
{
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
try
{
int sup1 = Convert.ToInt32(txt_supply_1.Text);
int sup2 = Convert.ToInt32(txt_supply_2.Text);
int sup3 = Convert.ToInt32(txt_supply_3.Text);
textBox2.Text = sup1 + sup2 + sup3 + "";
}
catch(Exception ee)
{
MessageBox.Show(ee+"");
}
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
try
{
int sup1 = Convert.ToInt32(txt_demand_1.Text);
int sup2 = Convert.ToInt32(txt_demand_2.Text);
int sup3 = Convert.ToInt32(txt_demand_3.Text);
int sup4 = Convert.ToInt32(txt_demand_4.Text);
textBox1.Text = sup1 + sup2 + sup3 +sup4+ "";
}
catch (Exception ee)
{
MessageBox.Show(ee + "");
}
}
Subscribe to:
Posts (Atom)