Update a TextBox every n seconds with an output from the OpenHardwareMonitor library
<p>For now its showing the temperature once.
I want it to work like in openhardwaremonitor original program that the temperature change/update every each second or according to if there is any change in the temperatures im not sure how it work there.</p>

<p>What i did is took out all the foreach loops from the constructor and put it in a timer tick event. But it dosent work. In openhardwaremonitor its showing changed to 51c while in my application its all the time on 44c as it was in the first time i ran the application.</p>

<p>I used a breakpoint on the textBox line and sometimes its getting there sometimes its just doing the inner loop but dosent pass the if and dosent get to the messagebox and if it does get to the messagebox its still showing 44c .</p>

<p>The code:</p>

<pre><code>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;
using System.Management;
using OpenHardwareMonitor.Hardware;

namespace NvidiaTemp
{
    public partial class Form1 : Form
    {
        Computer computer = new Computer();
        public Form1()
        {
            InitializeComponent();

            computer.Open();
            computer.GPUEnabled = true;
            timer1.Enabled = true;





        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            foreach (var hardwareItem in computer.Hardware)
            {

                if (hardwareItem.HardwareType == HardwareType.GpuNvidia)
                {
                    foreach (var sensor in hardwareItem.Sensors)
                    {
                        if (sensor.SensorType == SensorType.Temperature)
                        {
                            //   MessageBox.Show(String.Format("The current temperature is {0}", sensor.Value));
                            textBox1.Text = String.Format("The current temperature is {0}", sensor.Value);
                        }
                    }
                }

            }
        }
    }
}
</code></pre>

<ol>
<li><p>Why it dosent update it dosent get to the textBox line each time its doing the loop ?</p></li>
<li><p>Does it updating the temperature onlt if there is a change in the temperature value or its working with a timer in the openhardwaremonitor original program ?</p></li>
</ol>
