Forums

C# help

Quick find code: 261-262-38-65556859

Charles
Dec Member 2023

Charles

Posts: 9,155 Rune Posts by user Forum Profile RuneMetrics Profile
I want to have a msgbox show on a specified time...

for example, a msgbox would show up at 01:00; What would be needed for this?

I'm not fluent with c# by any means, just kinda learning as I go so be lenient with me, thanks!

18-Jan-2015 23:14:55

Was Zeus

Was Zeus

Posts: 22,388 Opal Posts by user Forum Profile RuneMetrics Profile
idk ZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZE

20-Jan-2016 16:50:48

Darth owner
Dec Member 2011

Darth owner

Posts: 158 Iron Posts by user Forum Profile RuneMetrics Profile
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
timer1.Interval = 1000;
timer1.Enabled = true;
}

private void timer1_Tick(object sender, EventArgs e)
{
if (lastRunDate != System.DateTime.Now.ToString("yyyy-MM-dd&quot ;) )
{
String str = System.DateTime.Now.ToString("h:mm tt&quot ;) ;

if (str.Equals("1:00 AM&quot ;) )
{
lastRunDate = System.DateTime.Now.ToString("yyyy-MM-dd&quot ;) ;
MessageBox.Show(str);
}
}
}
this might work I believe, sorry about the smileys darn forums >.>
General in, and proud member of Rago PvM

20-Jan-2016 17:07:13 - Last edited on 21-Jan-2016 00:27:39 by Darth owner

A13d

A13d

Posts: 7,149 Rune Posts by user Forum Profile RuneMetrics Profile
I've never done C# before but as long as that if statement actually runs every 1000ms then it seems like it should work

Also some of those brackets look unclosed, but then again I don't know anything about the language so

20-Jan-2016 19:43:25

Was Zeus

Was Zeus

Posts: 22,388 Opal Posts by user Forum Profile RuneMetrics Profile
Meme status: undetected ZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZEUSZE

20-Jan-2016 21:58:32

Darth owner
Dec Member 2011

Darth owner

Posts: 158 Iron Posts by user Forum Profile RuneMetrics Profile
ya there was an unclosed one, dont have visual studio installed atm ( new ssd ) so just grabbed a project and did it in notepad.

normaly it should work no idea if OP wants it to work like this but at least he has a general idea now :)
General in, and proud member of Rago PvM

21-Jan-2016 00:26:27 - Last edited on 21-Jan-2016 00:33:20 by Darth owner

Quick find code: 261-262-38-65556859 Back to Top