📜  如何在 c# 代码示例中的文本框中最小化文本长度

📅  最后修改于: 2022-03-11 14:49:14.757000             🧑  作者: Mango

代码示例1
private void TextBox_LostFocus(object sender, RoutedEventArgs e)
{
    if (((TextBox)sender).Text.Length < 5)
    {
        MessageBox.Show("You need to write at least 5 characters");
    }
}