TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Aditya Chauhan
NA
102
57.4k
Not Able To Control Timer Control can any one help
Mar 10 2015 2:28 AM
i have made a timer control in main()
{
System.Timers.Timer aTimer = new System.Timers.Timer();
aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
aTimer.Start();
aTimer.Interval = 1000;
aTimer.Enabled = true;
}
and call it
private static void OnTimedEvent(object source, ElapsedEventArgs e)
{
try
{
foreach (System.Int32 i in Enum.GetValues(typeof(Keys)))
{
if (GetAsyncKeyState(i) == -32767)
{
if (Keys.Control == Control.ModifierKeys) Form1.crtl = 1;
if (Keys.K == (Keys)i) Form1.k = 1;
}
if (Form1.k == 1 && Form1.crtl == 1)
{
string response = ShowDialog("Password Required: ", "Password");
if (response.Equals("###########"))
{
Form1 frm = new Form1();
frm.Show();
Form1.k = 0;
Form1.crtl = 0;
}
}
else
{
Form1.k = 0;
Form1.crtl = 0;
}
}
}
catch (Exception)
{
}
finally
{
}
}
but in this case my show dialog form is open but again and again can any one help for this
my simple task is after show Dialog my timer will be stop
Reply
Answers (
7
)
find html control in in server side asp .net c#
Gas Pump