How to display the function values in a Rich Text box in c# windows form

  • Thread starter Thread starter varun_bwazz
  • Start date Start date
V

varun_bwazz

Guest
I have method called Test() . I want to print its values in a Text Box. I called the mehod Test() on a ButtonClick method. But its not displaying the values.

public void Test()
{
/* Flow board variable declaration */
UInt64 frpHandle = 0;
ushort Serial = 0;
ushort Version = 0;

/* Flow-rate acquisition variables */
byte sensor_index = 0; // sensor index coresponds to flow-unit port on the flowboard from 0 to 7
byte TimeCheck = 0;
float flow_rate = 0;
uint loop = 0;

frpHandle = frp_initialization(0);
RTBox.Text="\n FRP session initialized";
RTBox.Refresh();

frp_get_serial(frpHandle, ref Serial, ref Version);

RTBox.Text = ("\n FLOWBOARD SN:" + Convert.ToInt32(Serial));
RTBox.Refresh();

if (Serial != 0)
{
for (loop = 0; loop < 20; loop++)
{
frp_read_flow(frpHandle, sensor_index, ref TimeCheck, ref flow_rate);
RTBox.Text = ("\n Flow-rate:" + (flow_rate) + "\t ul/min");
RTBox.Refresh();

}
Thread.Sleep(100);
};

frp_close(frpHandle);
RTBox.Text = ("\n FRP session closed");
RTBox.Refresh();


}

private void button1_Click(object sender, EventArgs e)
{

Test();

}

Continue reading...
 
Back
Top