StatusStrip control displays information about an object being viewed on a form, the object components or contextual information that relates to that object's operation within the application. Typically, a StatusStrip consists of ToolStrip objects, but by default, StatusStrip has no panels.
You can use the Form. Invalidate(); or Form. Refresh(); methods.
A StatusStrip control displays information about an object being viewed on a Form, the object's components, or contextual information that relates to that object's operation within your application. Typically, a StatusStrip control consists of ToolStripStatusLabel objects, each of which displays text, an icon, or both.
You will need to add a ToolStripStatusLabel
to the StatusStrip
.
Then set the text of the label instead (you need to do a statusstrip.Refresh
as there is no refresh on the status-label).
The Text
property on the StatusStrip
comes from the StatusStrip inherits ToolStrip
(which in turn inherits Control
), but has no visual effect due to the nature of ToolStrips. It can be a bit confusing.
Example:
private void textBox1_TextChanged(object sender, EventArgs e)
{
//...
lines = Regex.Split(textBox1.Text.Trim(), "\r\n");
lineCount = lines.Count();
//this label is added in visual editor using the default name
ToolStripStatusLabel1.Text = string.Format("Lines: {0}", lineCount);
StatusStrip1.Refresh();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With