I am very new to C sharp programming. I have the design like as shown below attached image.
My concept is i have to set some volume in "Transfer volume" text box (for example 100) and then press "set" button. It automatically sets the scale of picture box, it is working fine.
Now i want to fill the picture box with colors when i click "Regenerate" button. The percentage of color to be filled in picture box should be the number in the TextBox of that regarding color or liquid.
for example
if i set GasPhase =5 ; Hydrocarbon Liquid =5; Water= 5; Oil Based Mud =5; Water Based Mud =5 ; Not Identified = 75.
then the picture has to fill with 75 % with "Not Identified" color and GasPhase color with 5 % e.t.c.
I have the written some code as shown below.
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 test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void txtTransferVolume_TextChanged(object sender, EventArgs e)
{
}
private void txtTransferSet_Click(object sender, EventArgs e)
{
string value = txtTransferVolume.Text;
double midvalue = Convert.ToDouble(value);
lblTransferBottleMax.Text = value;
lblTransferBottleMid.Text = (midvalue / 2).ToString();
}
private void chkTransferManual_CheckedChanged(object sender, EventArgs e)
{
if (chkTransferManual.Checked)
{
txtTransferGas.Enabled = true;
txtTransferHydrocarbonLiq.Enabled = true;
txtTransferOilBasedMud.Enabled = true;
txtTransferWater.Enabled = true;
txtTransferWaterBasedMud.Enabled = true;
txtTransferNotIdentified.Enabled = true;
}
else
{
txtTransferGas.Enabled = false;
txtTransferHydrocarbonLiq.Enabled = false;
txtTransferOilBasedMud.Enabled = false;
txtTransferWater.Enabled = false;
txtTransferWaterBasedMud.Enabled = false;
txtTransferNotIdentified.Enabled = false;
txtTransferGas.Clear();
txtTransferHydrocarbonLiq.Clear();
txtTransferOilBasedMud.Clear();
txtTransferWater.Clear();
txtTransferWaterBasedMud.Clear();
txtTransferNotIdentified.Clear();
}
}
private void btnTransferBottleRegenerate_Click(object sender, EventArgs e)
{
}
}
}
Please help me how to fill as i want.
My design image
Thanks in advance.