I'm building a C# Gui. Included in it is a Refresh event which gets called every second or so to refresh the screen.
private void RefreshEverySecond_Tick(object o, EventArgs a)
{
if (Condition1)
{
QuickStatusTextBox.Text = "Condition 1";
QuickStatusTextBox.Font = new Font(QuickStatusTextBox.Font, FontStyle.Bold);
}
else
{
QuickStatusTextBox.Text = "Condition 2";
QuickStatusTextBox.Font = new Font(QuickStatusTextBox.Font, FontStyle.Regular);
}
}
In researching the way to do this, I've seen answers like this which encourage this behavior:
Easiest way to change font and font size with visual C#
BUT I've also seen a lot of chatter saying I should be using "Using" for IDisposable objects which I gather Font is.
When should I use "using" blocks in C#?
And examples of using with fonts: http://msdn.microsoft.com/en-us/library/yh598w02.aspx
Question: What is the right way to change a text box from Bold to Regular at periodic intervals? Does my method violate any rules or risk a memory leak or contention because I'm not using "using", and is there a "proper" way using Using? Remember this updates every second... so I'm likely keeping the Garbage collector busy but what other side effects are going to bite me?