private void textBoxNotes_ClientSizeChanged(object sender, EventArgs e)
{
if (this.NoteTextChanged != null)
this.NoteTextChanged(this, e);
if (!this._busy)
{
this._busy = true;
Size tS = TextRenderer.MeasureText(this.textBoxNotes.Text, this.textBoxNotes.Font);
bool Hsb = this.textBoxNotes.ClientSize.Height < tS.Height + Convert.ToInt32(this.textBoxNotes.Font.Size);
bool Vsb = this.textBoxNotes.ClientSize.Width < tS.Width;
if (Hsb && Vsb && this.textBoxNotes.ScrollBars != ScrollBars.Both)
this.textBoxNotes.ScrollBars = ScrollBars.Both;
else if (!Hsb && !Vsb && this.textBoxNotes.ScrollBars != ScrollBars.None)
this.textBoxNotes.ScrollBars = ScrollBars.None;
else if (Hsb && !Vsb && this.textBoxNotes.ScrollBars != ScrollBars.Vertical)
this.textBoxNotes.ScrollBars = ScrollBars.Vertical;
else if (!Hsb && Vsb && this.textBoxNotes.ScrollBars != ScrollBars.Horizontal)
this.textBoxNotes.ScrollBars = ScrollBars.Horizontal;
this._busy = false;
}
}