+ 1

can somebody explain, what is percentext and it's function, I'm having a hard time fixing my error codes

C# Percentext

27th Jun 2023, 4:33 PM
mira
mira - avatar
10 Réponses
+ 3
Please link your code so we can check on it.
27th Jun 2023, 4:34 PM
Lisa
Lisa - avatar
+ 3
So where is the pecentext object defined? Did you check if there's a typo?
27th Jun 2023, 4:57 PM
Lisa
Lisa - avatar
+ 2
without seeing code and knowing what you try to do, we can't help.
27th Jun 2023, 4:42 PM
Lisa
Lisa - avatar
+ 2
You have progressBar1. How did you create it?
27th Jun 2023, 5:01 PM
Lisa
Lisa - avatar
+ 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.
27th Jun 2023, 5:40 PM
Brian
Brian - avatar
0
i am writing code using visual basic
27th Jun 2023, 4:35 PM
mira
mira - avatar
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"); } } }
27th Jun 2023, 4:46 PM
mira
mira - avatar
0
it says "the name 'percentext' does not exist in the current context
27th Jun 2023, 4:54 PM
mira
mira - avatar
0
can i ask what is percentext object defined? i think that is the problem
27th Jun 2023, 4:59 PM
mira
mira - avatar
0
I'm using a toolbox in visual basic, find the progressBar and then placed it in the form1
27th Jun 2023, 5:04 PM
mira
mira - avatar