Help please come up with an algorithm so that progressBar is filled in half ( progressBar.Maximum / 2 ) with textBox != string.Empty . TextBox-a _TextChanged event is useful to _TextChanged . But I'm terribly confused with the flags) The user must enter something in the textBox , the progress bar is filled.

    1 answer 1

     private void tb_Name_TextChanged(object sender, EventArgs e) { if (tb_Name.Text != string.Empty) { if (!isHalf) { pb.Value += (pb.Maximum / 2); isHalf = true; } } else { pb.Value -= (pb.Maximum / 2); isHalf = false; } }