+ 1
can somebody explain, what is percentext and it's function, I'm having a hard time fixing my error codes
C# Percentext
10 odpowiedzi
+ 3
Please link your code so we can check on it.
+ 3
So where is the pecentext object defined? Did you check if there's a typo?
+ 2
without seeing code and knowing what you try to do, we can't help.
+ 2
You have progressBar1. How did you create it?
+ 1
Based on this code, there should be a TextBox or Label on the form (Form1) named percentext. Perhaps it got deleted inadvertently. Just add a new one so it can display the numeric percent progress.
0
i am writing code using visual basic
0
i will paste here, the code is for form1 in visual basic
namespace eight
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void timer1_Tick(object sender, EventArgs e)
        {
            progressBar1.Increment(1);
            percentext.Text = progressBar1.Value.ToString() + "%";
            if (progressBar1.Value >= progressBar1.Maximum)
            {
                timer1.Stop();
                this.Hide();
                Form2 form2 = new Form2();
                form2.Show();
            }
        }
        private void btn1_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            progressBar1.Show();
            loading.Show();
            percentext.Show("Loading");
        }
    }
}
0
it says "the name 'percentext' does not exist in the current context
0
can i ask what is percentext object defined? i think that is the problem
0
I'm using a toolbox in visual basic, find the progressBar and then placed it in the form1



