C# Help.

AOD

In Runtime
Messages
348
I just started programming like 2 days ago and I'm trying to make a timer. I got a progress bar going but I want something to say how much time is left.
This is what I got so far:
namespace WindowsApplication1
{
public partial class Form1 : Form
{



public Form1()
{
InitializeComponent();
}

private void timer1_Tick(object sender, EventArgs e)
{
progressBar1.Value = (progressBar1.Value + 1);


}

private void Start_Click(object sender, EventArgs e)
{
timer1.Enabled = true;
progressBar1.Enabled = true;
timer2.Enabled = true;
}



private void Form1_Load(object sender, EventArgs e)
{

}

private void Stop_Click(object sender, EventArgs e)
{
timer1.Enabled = false;
progressBar1.Enabled = false;
progressBar1.Value = 0;
timer2.Enabled = false;
maskedTextBox1.Text = " ";
}

private void progressBar1_Click(object sender, EventArgs e)
{

}



private void maskedTextBox1_MaskInputRejected(object sender, MaskInputRejectedEventArgs e)
{

}

private void timer2_Tick(object sender, EventArgs e)
{

maskedTextBox1.Text = maskedTextBox1.Text + "0001"; <-- Doesn't Work.

}
}
}

(Also how do I get if statements to work lol, all mine come up with errors and stuff this is what i do for them e.g. if (progressbar1.Value = 30) Then it gives an error)
Remember I'm pretty much n00b at this stuff so go easy. :p
 
I got it working and Also worked out it == for the if thing lol. Now just trying to get it to add an extra 0 at the start of the seconds if it is >10. Thats proving a bit annoying but hey seeing I just started c# with no other language knowledge and I haven't looked at any tuts really I think it's alright. =D
 
May I ask why did you start with C#? I know it's as easy as VB, but it seems rather bizzare for a person who has no programming background to start with C#...
 
Now i'm going to sound rather noobish, but that's ok. What on earth is C#? I've heard of C and C++, but i have no clue what C# is.
 
C# is a somewhat new OOP lang, its very similar to java as well as C and C++.
it is pronounced C-Sharp
 
Sasuke12 said:
May I ask why did you start with C#? I know it's as easy as VB, but it seems rather bizzare for a person who has no programming background to start with C#...

what would you start off with?
 
Back
Top Bottom