Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 02-18-2006, 02:07 AM   #1
AOD
In Runtime
 
AOD's Avatar
 
Join Date: Nov 2005
Posts: 348
Question C# Help.

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.
__________________

__________________
Yes I have another problem...
AOD is offline   Reply With Quote
Old 02-18-2006, 04:28 AM   #2
AOD
In Runtime
 
AOD's Avatar
 
Join Date: Nov 2005
Posts: 348
Default Re: C# Help.

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
__________________

__________________
Yes I have another problem...
AOD is offline   Reply With Quote
Old 04-22-2006, 01:45 AM   #3
Beta Member
 
Join Date: Apr 2006
Posts: 5
Default Re: C# Help.

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#...
Sasuke12 is offline   Reply With Quote
Old 04-22-2006, 10:21 AM   #4
Baseband Member
 
Join Date: Mar 2006
Posts: 39
Default Re: C# Help.

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.
__________________
Don't forget to vote in my pole on who you think will win the Stanley Cup

Go Sens Go!
Nucular is offline   Reply With Quote
Old 04-22-2006, 11:22 AM   #5
Daemon Poster
 
uid=[0]'s Avatar
 
Join Date: Apr 2006
Posts: 906
Send a message via Yahoo to uid=[0]
Default Re: C# Help.

C# is a somewhat new OOP lang, its very similar to java as well as C and C++.
it is pronounced C-Sharp
__________________
"Security is nothing more than a thought that makes you sleep well at night." - Me
MCSE/MCSA
Security+/Network+
Wireless Network Security Spec.
uid=[0] is offline   Reply With Quote
Old 04-22-2006, 02:17 PM   #6
Baseband Member
 
Join Date: Mar 2006
Posts: 39
Default Re: C# Help.

alright , thanks.
__________________
Don't forget to vote in my pole on who you think will win the Stanley Cup

Go Sens Go!
Nucular is offline   Reply With Quote
Old 04-22-2006, 06:37 PM   #7
Daemon Poster
 
uid=[0]'s Avatar
 
Join Date: Apr 2006
Posts: 906
Send a message via Yahoo to uid=[0]
Default Re: C# Help.

Sure no prob.
__________________
"Security is nothing more than a thought that makes you sleep well at night." - Me
MCSE/MCSA
Security+/Network+
Wireless Network Security Spec.
uid=[0] is offline   Reply With Quote
Old 04-24-2006, 02:41 PM   #8
j03
~~~~~~~~
 
Join Date: Jan 2005
Location: Wales
Posts: 5,556
Send a message via MSN to j03
Default Re: C# Help.

Quote:
Originally Posted by Sasuke12
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?
__________________

j03 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 03:53 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0