I would like to create a variable which uses another variable outside of a function, like this:
private void tb_TextChanged(object sender, TextChangedEventArgs e)
{
...
}
TextStyle txtstyle = new TextStyle(new SolidBrush(Color.Red), null, FontStyle.Regular); // the variable
private void tb_VisibleRangeChangedDelayed(object sender, EventArgs e)
{
...
}
I want to replace Color.Red in txtstyle with a custom color which is in the applications setting. How can I achieve this?