Click here to Skip to main content
15,909,656 members
Home / Discussions / C#
   

C#

 
AnswerRe: bitmap lockbits/unlockbits Pin
Kornfeld Eliyahu Peter22-Jul-14 20:06
professionalKornfeld Eliyahu Peter22-Jul-14 20:06 
GeneralRe: bitmap lockbits/unlockbits Pin
V.22-Jul-14 20:13
professionalV.22-Jul-14 20:13 
QuestionClasses Pin
AnilUppala22-Jul-14 1:52
AnilUppala22-Jul-14 1:52 
AnswerRe: Classes Pin
Ravi Bhavnani22-Jul-14 2:06
professionalRavi Bhavnani22-Jul-14 2:06 
GeneralRe: Classes Pin
AnilUppala22-Jul-14 2:12
AnilUppala22-Jul-14 2:12 
QuestionHELP!!!! Pin
Member 1094467922-Jul-14 1:22
Member 1094467922-Jul-14 1:22 
AnswerRe: HELP!!!! Pin
Dave Kreskowiak22-Jul-14 2:16
mveDave Kreskowiak22-Jul-14 2:16 
SuggestionRe: HELP!!!! Pin
Richard Deeming22-Jul-14 2:18
mveRichard Deeming22-Jul-14 2:18 
AnswerRe: HELP!!!! Pin
OriginalGriff22-Jul-14 3:08
mveOriginalGriff22-Jul-14 3:08 
QuestionNo column found exception occourd Pin
vishavajeet21-Jul-14 1:56
vishavajeet21-Jul-14 1:56 
AnswerRe: No column found exception occourd Pin
Kornfeld Eliyahu Peter21-Jul-14 1:59
professionalKornfeld Eliyahu Peter21-Jul-14 1:59 
GeneralRe: No column found exception occourd Pin
vishavajeet21-Jul-14 2:06
vishavajeet21-Jul-14 2:06 
AnswerRe: No column found exception occourd Pin
Kornfeld Eliyahu Peter21-Jul-14 2:21
professionalKornfeld Eliyahu Peter21-Jul-14 2:21 
GeneralRe: No column found exception occourd Pin
vishavajeet21-Jul-14 2:50
vishavajeet21-Jul-14 2:50 
AnswerRe: No column found exception occourd Pin
Kornfeld Eliyahu Peter21-Jul-14 2:51
professionalKornfeld Eliyahu Peter21-Jul-14 2:51 
GeneralRe: No column found exception occourd Pin
vishavajeet21-Jul-14 3:08
vishavajeet21-Jul-14 3:08 
GeneralRe: No column found exception occourd Pin
Eddy Vluggen21-Jul-14 3:02
professionalEddy Vluggen21-Jul-14 3:02 
SuggestionRe: No column found exception occourd Pin
Richard Deeming21-Jul-14 3:53
mveRichard Deeming21-Jul-14 3:53 
GeneralRe: No column found exception occourd Pin
vishavajeet21-Jul-14 23:34
vishavajeet21-Jul-14 23:34 
QuestionGiving input using App.config Pin
Mohan Subramani19-Jul-14 0:17
Mohan Subramani19-Jul-14 0:17 
Hello Guys,

Am developing an EXE for Coundowntimer functionality, I have used the below code for creating countdowntimer.

In Present Code: We need to give input for the "Time" and then start the timer in the output dialog
(Please refer the attached file)

Am planning to implement a app.config for Countdowntimer.exe, so that i can give my time directly in Countdowntimer.config and when i run my Countdowntimer.exe, the timer automatically will pick the time details given in Countdowntimer.config as input and start the timer.

my present code:

namespace countdownTimer
{
public partial class Form1 : Form
{
public int seconds; // Seconds.
public int minutes; // Minutes.
public int hours; // Hours.
public bool paused; // State of the timer [PAUSED/WORKING].

public Form1()
{
InitializeComponent();
}
private void button2_Click(object sender, EventArgs e)
{
if (paused != true)
{
if ((textBox1.Text != "") && (textBox2.Text != "") && (textBox3.Text != ""))
{
timer1.Enabled = true;
button2.Enabled = false;
textBox1.Enabled = false;
textBox2.Enabled = false;
textBox3.Enabled = false;


try
{
minutes = System.Convert.ToInt32(textBox2.Text);
seconds = System.Convert.ToInt32(textBox3.Text);
hours = System.Convert.ToInt32(textBox1.Text);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
else
{
MessageBox.Show("Incomplete settings!");
}
}
else
{
timer1.Enabled = true;
paused = false;
button2.Enabled = false;
}
}
private void timer1_Tick(object sender, EventArgs e)
{
// Verify if the time didn't pass.
if ((minutes == 0) && (hours == 0) && (seconds == 0))
{
// If the time is over, clear all settings and fields.
// Also, show the message, notifying that the time is over.
timer1.Enabled = false;
button2.Enabled = true;
textBox3.Clear();
textBox2.Clear();
textBox1.Enabled = true;
textBox3.Enabled = true;
textBox2.Enabled = true;
textBox1.Enabled = true;
lblHr.Text = "00";
lblMin.Text = "00";
lblSec.Text = "00";
}
else
{
// Else continue counting.
if (seconds < 1)
{
seconds = 59;
if (minutes == 0)
{
minutes = 59;
if (hours != 0)
hours -= 1;
}
else
{
minutes -= 1;
}
}
else
seconds -= 1;
// Display the current values of hours, minutes and seconds in
// the corresponding fields.
lblHr.Text = hours.ToString();
lblMin.Text = minutes.ToString();
lblSec.Text = seconds.ToString();
}
}
private void button3_Click(object sender, EventArgs e)
{
// Stop the timer.
paused = false;
timer1.Enabled = false;
button2.Enabled = true;
textBox3.Clear();
textBox2.Clear();
textBox1.Clear();
textBox1.Enabled = true;
textBox3.Enabled = true;
textBox2.Enabled = true;
textBox1.Enabled = true;
lblHr.Text = "00";
lblMin.Text = "00";
lblSec.Text = "00";
}
private void Form1_Load(object sender, EventArgs e)
{

}
}
}


Please suggest how do i provide a the input to the timer Hr: Min: Sec using app.config file.

-- modified 19-Jul-14 7:18am.
AnswerRe: Giving input using App.config Pin
dan!sh 20-Jul-14 19:26
professional dan!sh 20-Jul-14 19:26 
QuestionVirtual Drive in c# Pin
Bikash Panigrahi18-Jul-14 19:31
Bikash Panigrahi18-Jul-14 19:31 
AnswerRe: Virtual Drive in c# Pin
OriginalGriff18-Jul-14 21:33
mveOriginalGriff18-Jul-14 21:33 
AnswerRe: Virtual Drive in c# Pin
Eddy Vluggen18-Jul-14 22:24
professionalEddy Vluggen18-Jul-14 22:24 
AnswerRe: Virtual Drive in c# Pin
Dilan Shaminda19-Jul-14 0:05
professionalDilan Shaminda19-Jul-14 0:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.