Can someone tell me how you can use a variable that has been defined within a textbox control in other controls and methods. In standard methods this is fine but not sure about controls. The alternative is to make it a global variable but I don't want to do that. The code is below:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Clean_Encoder_Box
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void goBtn_Click(object sender, EventArgs e)
{
}
private void freqValueTb_TextChanged(object sender, EventArgs e)
{
string freqValueSt = freqValueTb.Text;
ushort freqValueUs = ushort.Parse(freqValueSt);
}
}
}