Advertisement
Guest User

Untitled

a guest
Jun 20th, 2015
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.00 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace CheckList_Reminders
  12. {
  13. public partial class Form1 : Form
  14. {
  15. ToolTip t1 = new ToolTip();
  16.  
  17. int TogMove;
  18. int MValX;
  19. int MValY;
  20.  
  21. bool addToolShow = false;
  22.  
  23. string newList;
  24. string dateNow;
  25.  
  26. int todayListN, TomorrowListN;
  27.  
  28. bool timeVerifier;
  29.  
  30. bool TDShow;
  31. bool TMShow;
  32.  
  33. string[] tdTsk = new string[10];
  34. string[] tmTsk = new string[10];
  35. public Form1()
  36. {
  37. InitializeComponent();
  38. }
  39.  
  40. private void Form1_Load(object sender, EventArgs e)
  41. {
  42. string YN = yearNow();
  43. string dateNowL = YN + DateTime.Now.Month.ToString("00") + DateTime.Now.Day.ToString("00");
  44. dateNow = dateNowL;
  45. process();
  46. showTodayList();
  47.  
  48. }
  49.  
  50. private void Form1_MouseDown(object sender, MouseEventArgs e)
  51. {
  52. TogMove = 1;
  53. MValX = e.X;
  54. MValY = e.Y;
  55. }
  56.  
  57. private void Form1_MouseUp(object sender, MouseEventArgs e)
  58. {
  59. TogMove = 0;
  60. }
  61.  
  62. private void Form1_MouseMove(object sender, MouseEventArgs e)
  63. {
  64. if (TogMove == 1)
  65. {
  66. this.SetDesktopLocation(MousePosition.X - MValX, MousePosition.Y - MValY);
  67. }
  68. }
  69.  
  70. private void timePickH_SelectedIndexChanged(object sender, EventArgs e)
  71. {
  72.  
  73. }
  74.  
  75. private void checkBox1_CheckedChanged(object sender, EventArgs e)
  76. {
  77. if (reminderCheck.Checked == true)
  78. {
  79. dateInput.Enabled = true;
  80. tTxt.Enabled = true;
  81. timeInput.Enabled = true;
  82. dateInput.Visible = true;
  83. tTxt.Visible = true;
  84. timeInput.Visible = true;
  85. msgInputBD.Enabled = true;
  86. }
  87. else
  88. {
  89. tTxt.Enabled = false;
  90. timeInput.Enabled = false;
  91. tTxt.Visible = false;
  92. timeInput.Visible = false;
  93. }
  94. }
  95.  
  96. private void timePickM_SelectedIndexChanged(object sender, EventArgs e)
  97. {
  98.  
  99. }
  100.  
  101. private void addBtn_Click(object sender, EventArgs e)
  102. {
  103. addBtn.Visible = false;
  104. showAddtool();
  105. }
  106.  
  107. void showAddtool()
  108. {
  109. if (addToolShow == false)
  110. {
  111. msgInput.Enabled = true;
  112. reminderCheck.Enabled = true;
  113. dateInput.Enabled = true;
  114. submitAdd.Enabled = true;
  115. cancleAdd.Enabled = true;
  116. msgInputBD.Enabled = true;
  117.  
  118.  
  119. msgInput.Visible = true;
  120. dateInput.Visible = true;
  121. reminderCheck.Visible = true;
  122. submitAdd.Visible = true;
  123. cancleAdd.Visible = true;
  124. msgInputBD.Visible = true;
  125.  
  126. //addToolShow = true;
  127. }
  128. else
  129. {
  130. msgInput.Enabled = false;
  131. reminderCheck.Enabled = false;
  132. dateInput.Enabled = false;
  133. tTxt.Enabled = false;
  134. timeInput.Enabled = false;
  135. submitAdd.Enabled = false;
  136. cancleAdd.Enabled = false;
  137. msgInputBD.Enabled = false;
  138.  
  139. msgInput.Visible = false;
  140. reminderCheck.Visible = false;
  141. dateInput.Visible = false;
  142. tTxt.Visible = false;
  143. timeInput.Visible = false;
  144. submitAdd.Visible = false;
  145. cancleAdd.Visible = false;
  146. msgInputBD.Visible = false;
  147.  
  148. addToolShow = false;
  149. addBtn.Visible = true;
  150. addBtn.Enabled = true;
  151.  
  152. }
  153. }
  154.  
  155. private void submitAdd_Click(object sender, EventArgs e)
  156. {
  157.  
  158. showAddtool();
  159. if (msgInput.Text == "")
  160. {
  161.  
  162. MessageBox.Show("You didn't type any message in textbox", "Add format ERROR!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
  163. }
  164. else
  165. {
  166. if (reminderCheck.Checked == true)
  167. {
  168. timeVerifier = false;
  169. timeInputCheck();
  170. if (timeVerifier == false)
  171. MessageBox.Show("Incorrect remind time. Please try again.\nExample: 09:59\n\n If you do not want to remind uncheck Reminder box", "Add format ERROR!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
  172. else
  173. {
  174. string date_set = dateInput.Value.ToString("yyyyMMdd");
  175. string time_set = timeInput.Text.Substring(0, 2) + timeInput.Text.Substring(3, 2);
  176. newList = "UNCH" + date_set + time_set + msgInput.Text;
  177. save();
  178. addToolShow = true;
  179. showAddtool();
  180. msgInput.Clear();
  181. reminderCheck.Checked = false;
  182. timeInput.Clear();
  183.  
  184. }
  185. }
  186. else
  187. {
  188. string date_set = dateInput.Value.ToString("yyyyMMdd");
  189. string time_set = "9999";
  190. newList = "UNCH" + date_set + time_set + msgInput.Text;
  191.  
  192. save();
  193. addToolShow = true;
  194. showAddtool();
  195. msgInput.Clear();
  196. reminderCheck.Checked = false;
  197. timeInput.Clear();
  198. }
  199. }
  200. process();
  201. showTodayList();
  202.  
  203. }
  204.  
  205. private void cancleAdd_Click(object sender, EventArgs e)
  206. {
  207. showAddtool();
  208. addToolShow = true;
  209. }
  210.  
  211.  
  212. bool firstLine;
  213. void save()
  214. {
  215.  
  216. System.IO.StreamWriter file = new System.IO.StreamWriter(@"C:\saveList.txt",true);
  217. file.WriteLine(newList);
  218. file.Close();
  219.  
  220.  
  221. saveMessage();
  222. }
  223.  
  224. void saveMessage()
  225. {
  226. if (reminderCheck.Checked == false)
  227. {
  228. MessageBox.Show
  229. (newList.Substring(16) + "\n\n at "
  230. + newList.Substring(10, 2) + "/"
  231. + newList.Substring(8, 2) + "/"
  232. + newList.Substring(4, 4) + "\n\n ADDED!");
  233. }
  234. else
  235. {
  236. MessageBox.Show
  237. (newList.Substring(16) + "\n\n at "
  238. + newList.Substring(12, 2) + ":"
  239. + newList.Substring(14, 2) + " "
  240. + newList.Substring(10, 2) + "/"
  241. + newList.Substring(8, 2) + "/"
  242. + newList.Substring(4, 4) + "\n\n ADDED!");
  243.  
  244. }
  245.  
  246. }
  247.  
  248. void process()
  249. {
  250. todayListN = 0;
  251. TomorrowListN = 0;
  252.  
  253.  
  254. bool firstLineTD = false;
  255. bool firstLineTM = false;
  256. string[] lines = System.IO.File.ReadAllLines(@"C:\saveList.txt");
  257. foreach (string line in lines)
  258. {
  259.  
  260. string date = line.Substring(4,8);
  261.  
  262. if (date == dateNow)
  263. {
  264. todayListN++;
  265. if (firstLineTD == false)
  266. {
  267. System.IO.StreamWriter file = new System.IO.StreamWriter(@"C:\todayList.txt");
  268. file.WriteLine(line);
  269. file.Close();
  270. firstLineTD = true;
  271. }
  272. else
  273. {
  274. System.IO.StreamWriter file = new System.IO.StreamWriter(@"C:\todayList.txt", true);
  275. file.WriteLine(line);
  276. file.Close();
  277. }
  278.  
  279. }
  280. }
  281.  
  282. string[] TM = System.IO.File.ReadAllLines(@"C:\saveList.txt");
  283. foreach (string line in TM)
  284. {
  285. string date = line.Substring(4, 8);
  286. if (date == tomorrowDate())
  287. {
  288. TomorrowListN++;
  289.  
  290. if (firstLineTM == false)
  291. {
  292. System.IO.StreamWriter file = new System.IO.StreamWriter(@"C:\tomorrowList.txt");
  293. file.WriteLine(line);
  294. file.Close();
  295. firstLineTM = true;
  296. }
  297. else
  298. {
  299. System.IO.StreamWriter file = new System.IO.StreamWriter(@"C:\tomorrowList.txt", true);
  300. file.WriteLine(line);
  301. file.Close();
  302. }
  303.  
  304. }
  305. }
  306.  
  307. }
  308.  
  309. private void button1_Click(object sender, EventArgs e)
  310. {
  311. process();
  312. }
  313.  
  314. string yearNow()
  315. {
  316. int defaultYearNow = int.Parse(DateTime.Now.Year.ToString("0000"));
  317.  
  318. if (defaultYearNow < 2400)
  319. return (defaultYearNow + 543).ToString();
  320. else
  321. return defaultYearNow.ToString();
  322. }
  323.  
  324. string tomorrowDate()
  325. {
  326. string YNstring = yearNow();
  327. bool leapYear = false;
  328. int yn = int.Parse(YNstring) - 543;
  329.  
  330. if (yn % 4 == 0)
  331. {
  332. if (yn % 100 == 0)
  333. {
  334. if (yn % 400 == 0)
  335. leapYear = true;
  336. }
  337. else
  338. {
  339. leapYear = true;
  340. }
  341. }
  342.  
  343. int month = int.Parse(dateNow.Substring(4,2));
  344.  
  345. if ((month == 1 ||
  346. month == 3 ||
  347. month == 5 ||
  348. month == 7 ||
  349. month == 8 ||
  350. month == 10)
  351. &&
  352. (DateTime.Now.ToString("00") == "31"))
  353. return yearNow() + (int.Parse(dateNow.Substring(4, 2)) + 1).ToString() + "01";
  354.  
  355.  
  356. else if ((month == 4 ||
  357. month == 6 ||
  358. month == 9 ||
  359. month == 11)
  360. && (DateTime.Now.ToString("00") == "30"))
  361. return yearNow() + (int.Parse(dateNow.Substring(4, 2)) + 1).ToString() + "01";
  362.  
  363.  
  364.  
  365.  
  366. else if (((month == 2) && (leapYear == true)) && (DateTime.Now.ToString("00") == "29"))
  367. return yearNow() + (int.Parse(dateNow.Substring(4, 2)) + 1).ToString() + "01";
  368.  
  369.  
  370.  
  371.  
  372. else if (((month == 2) && (leapYear == false)) && (DateTime.Now.ToString("00") == "28"))
  373. return yearNow() + (int.Parse(dateNow.Substring(4, 2)) + 1).ToString() + "01";
  374.  
  375.  
  376.  
  377. else if (month == 12 && DateTime.Now.ToString("00") == "31")
  378. {
  379. string nextYear = (int.Parse(YNstring) + 1).ToString();
  380. return nextYear + (int.Parse(dateNow.Substring(4, 2)) + 1).ToString() + "01";
  381. }
  382.  
  383. else
  384. return dateNow.Substring(0, 6) + (int.Parse(dateNow.Substring(6, 2)) + 1).ToString();
  385. }
  386.  
  387. private void label1_Click(object sender, EventArgs e)
  388. {
  389. showTomorrowList();
  390. }
  391.  
  392. void timeInputCheck()
  393. {
  394.  
  395. bool HVerifier = false;
  396. bool MVerifier = false;
  397. string HCheck;
  398. if (timeInput.Text == "" || timeInput.Text.Length < 5)
  399. {
  400. timeVerifier = false;
  401. }
  402. else
  403. {
  404. for (int i = 0; i <= 23; i++)
  405. {
  406. if (i < 10)
  407. HCheck = "0" + i.ToString();
  408. else
  409. HCheck = i.ToString();
  410.  
  411.  
  412. if (HCheck == timeInput.Text.Substring(0, 2))
  413. {
  414. HVerifier = true;
  415. }
  416.  
  417. }
  418.  
  419. string MCheck;
  420. for (int i = 0; i <= 59; i++)
  421. {
  422. if (i < 10)
  423. MCheck = "0" + i.ToString();
  424. else
  425. MCheck = i.ToString();
  426.  
  427. if (MCheck == timeInput.Text.Substring(3, 2))
  428. {
  429. MVerifier = true;
  430. }
  431.  
  432. }
  433. if (HVerifier == true && MVerifier == true)
  434. {
  435. timeVerifier = true;
  436. }
  437. }
  438.  
  439. }
  440.  
  441. private void todayBar_Click(object sender, EventArgs e)
  442. {
  443. showTodayList();
  444. }
  445. private void tomorrowBar_Click(object sender, EventArgs e)
  446. {
  447. showTomorrowList();
  448. }
  449. void showTodayList()
  450. {
  451. hideTomorrowList();
  452.  
  453. process();
  454. int n=0;
  455. string[] lines = System.IO.File.ReadAllLines(@"C:\todayList.txt");
  456. foreach (string line in lines)
  457. {
  458. if (line.Substring(0, 4) == "UNCH")
  459. {
  460. n++;
  461. if (n == 1)
  462. {
  463. tdTask01(line); tdTsk[1] = line;
  464. }
  465. if (n == 2)
  466. {
  467. tdTask02(line); tdTsk[2] = line;
  468. }
  469. if (n == 3)
  470. {
  471. tdTask03(line); tdTsk[3] = line;
  472. }
  473. if (n == 4)
  474. {
  475. tdTask04(line); tdTsk[4] = line;
  476. }
  477. if (n == 5)
  478. {
  479. tdTask05(line); tdTsk[5] = line;
  480. }
  481. if (n == 6)
  482. {
  483. tdTask06(line); tdTsk[6] = line;
  484. }
  485. if (n == 7)
  486. {
  487. tdTask07(line); tdTsk[7] = line;
  488. }
  489. if (n == 8)
  490. {
  491. tdTask08(line); tdTsk[8] = line;
  492. }
  493. if (n == 9)
  494. {
  495. tdTask09(line); tdTsk[9] = line;
  496. }
  497. if (n == 10)
  498. {
  499. tdTask10(line); tdTsk[10] = line;
  500. }
  501. if (n > 10)
  502. tdTaskMore();
  503. }
  504. }
  505.  
  506. TDShow = true;
  507. TMShow = false;
  508.  
  509.  
  510. }
  511. void hideTomorrowList()
  512. {
  513. TDCheck01.Visible = false;
  514. TDCheck02.Visible = false;
  515. TDCheck03.Visible = false;
  516. TDCheck04.Visible = false;
  517. TDCheck05.Visible = false;
  518. TDCheck06.Visible = false;
  519. TDCheck07.Visible = false;
  520. TDCheck08.Visible = false;
  521. TDCheck09.Visible = false;
  522. TDCheck10.Visible = false;
  523.  
  524. todayT01.Visible = false;
  525. todayT02.Visible = false;
  526. todayT03.Visible = false;
  527. todayT04.Visible = false;
  528. todayT05.Visible = false;
  529. todayT06.Visible = false;
  530. todayT07.Visible = false;
  531. todayT08.Visible = false;
  532. todayT09.Visible = false;
  533. todayT10.Visible = false;
  534.  
  535. TodayMsg01.Visible = false;
  536. TodayMsg02.Visible = false;
  537. TodayMsg03.Visible = false;
  538. TodayMsg04.Visible = false;
  539. TodayMsg05.Visible = false;
  540. TodayMsg06.Visible = false;
  541. TodayMsg07.Visible = false;
  542. TodayMsg08.Visible = false;
  543. TodayMsg09.Visible = false;
  544. TodayMsg10.Visible = false;
  545.  
  546. TDRemind01.Visible = false;
  547. TDRemind02.Visible = false;
  548. TDRemind03.Visible = false;
  549. TDRemind04.Visible = false;
  550. TDRemind05.Visible = false;
  551. TDRemind06.Visible = false;
  552. TDRemind07.Visible = false;
  553. TDRemind08.Visible = false;
  554. TDRemind09.Visible = false;
  555. TDRemind10.Visible = false;
  556.  
  557. TomorrowMore.Visible = false;
  558. }
  559. void tdTask01(string tsk)
  560. {
  561. tomorrowBar.Location = new Point(1, 239);
  562. tomorrowTXT.Location = new Point(1, 245);
  563.  
  564. TDCheck01.Enabled = true;
  565. TDCheck01.Visible = true;
  566. TodayMsg01.Enabled = true;
  567. TodayMsg01.Visible = true;
  568.  
  569. if (tsk.Substring(12, 4) != "9999")
  570. {
  571. TDRemind01.Visible = true;
  572. TDRemind01.Enabled = true;
  573. TDRemind01.Text = "at "
  574. + tsk.Substring(12, 2) + ":"
  575. + tsk.Substring(14, 2);
  576. }
  577.  
  578. todayT01.Enabled = true;
  579. todayT01.Visible = true;
  580. TodayMsg01.Text = tsk.Substring(16);
  581. }
  582.  
  583. void tdTask02(string tsk)
  584. {
  585. tomorrowBar.Location = new Point(1, 288);
  586. tomorrowTXT.Location = new Point(1, 294);
  587.  
  588. TDCheck02.Enabled = true;
  589. TDCheck02.Visible = true;
  590. TodayMsg02.Enabled = true;
  591. TodayMsg02.Visible = true;
  592.  
  593. if (tsk.Substring(12, 4) != "9999")
  594. {
  595. TDRemind02.Visible = true;
  596. TDRemind02.Enabled = true;
  597. TDRemind02.Text = "at "
  598. + tsk.Substring(12, 2) + ":"
  599. + tsk.Substring(14, 2);
  600. }
  601.  
  602. todayT02.Enabled = true;
  603. todayT02.Visible = true;
  604. TodayMsg02.Text = tsk.Substring(16);
  605. }
  606. void tdTask03(string tsk)
  607. {
  608. tomorrowBar.Location = new Point(1, 335);
  609. tomorrowTXT.Location = new Point(1, 341);
  610.  
  611. TDCheck03.Enabled = true;
  612. TDCheck03.Visible = true;
  613. TodayMsg03.Enabled = true;
  614. TodayMsg03.Visible = true;
  615.  
  616. if (tsk.Substring(12, 4) != "9999")
  617. {
  618. TDRemind03.Visible = true;
  619. TDRemind03.Enabled = true;
  620. TDRemind03.Text = "at "
  621. + tsk.Substring(12, 2) + ":"
  622. + tsk.Substring(14, 2);
  623. }
  624.  
  625. todayT03.Enabled = true;
  626. todayT03.Visible = true;
  627. TodayMsg03.Text = tsk.Substring(16);
  628. }
  629. void tdTask04(string tsk)
  630. {
  631. tomorrowBar.Location = new Point(1, 381);
  632. tomorrowTXT.Location = new Point(1, 387);
  633.  
  634. TDCheck04.Enabled = true;
  635. TDCheck04.Visible = true;
  636. TodayMsg04.Enabled = true;
  637. TodayMsg04.Visible = true;
  638.  
  639. if (tsk.Substring(12, 4) != "9999")
  640. {
  641. TDRemind04.Visible = true;
  642. TDRemind04.Enabled = true;
  643. TDRemind04.Text = "at "
  644. + tsk.Substring(12, 2) + ":"
  645. + tsk.Substring(14, 2);
  646. }
  647.  
  648. todayT04.Enabled = true;
  649. todayT04.Visible = true;
  650. TodayMsg04.Text = tsk.Substring(16);
  651. }
  652. void tdTask05(string tsk)
  653. {
  654. tomorrowBar.Location = new Point(1, 427);
  655. tomorrowTXT.Location = new Point(1, 433);
  656.  
  657. TDCheck05.Enabled = true;
  658. TDCheck05.Visible = true;
  659. TodayMsg05.Enabled = true;
  660. TodayMsg05.Visible = true;
  661.  
  662. if (tsk.Substring(12, 4) != "9999")
  663. {
  664. TDRemind05.Visible = true;
  665. TDRemind05.Enabled = true;
  666. TDRemind05.Text = "at "
  667. + tsk.Substring(12, 2) + ":"
  668. + tsk.Substring(14, 2);
  669. }
  670.  
  671. todayT05.Enabled = true;
  672. todayT05.Visible = true;
  673. TodayMsg05.Text = tsk.Substring(16);
  674. }
  675. void tdTask06(string tsk)
  676. {
  677. tomorrowBar.Location = new Point(1, 473);
  678. tomorrowTXT.Location = new Point(1, 479);
  679.  
  680. TDCheck06.Enabled = true;
  681. TDCheck06.Visible = true;
  682. TodayMsg06.Enabled = true;
  683. TodayMsg06.Visible = true;
  684.  
  685. if (tsk.Substring(12, 4) != "9999")
  686. {
  687. TDRemind06.Visible = true;
  688. TDRemind06.Enabled = true;
  689. TDRemind06.Text = "at "
  690. + tsk.Substring(12, 2) + ":"
  691. + tsk.Substring(14, 2);
  692. }
  693.  
  694. todayT06.Enabled = true;
  695. todayT06.Visible = true;
  696. TodayMsg06.Text = tsk.Substring(16);
  697. }
  698. void tdTask07(string tsk)
  699. {
  700. tomorrowBar.Location = new Point(1, 519);
  701. tomorrowTXT.Location = new Point(1, 525);
  702.  
  703. TDCheck07.Enabled = true;
  704. TDCheck07.Visible = true;
  705. TodayMsg07.Enabled = true;
  706. TodayMsg07.Visible = true;
  707.  
  708. if (tsk.Substring(12, 4) != "9999")
  709. {
  710. TDRemind07.Visible = true;
  711. TDRemind07.Enabled = true;
  712. TDRemind07.Text = "at "
  713. + tsk.Substring(12, 2) + ":"
  714. + tsk.Substring(14, 2);
  715. }
  716.  
  717. todayT07.Enabled = true;
  718. todayT07.Visible = true;
  719. TodayMsg07.Text = tsk.Substring(16);
  720. }
  721. void tdTask08(string tsk)
  722. {
  723. tomorrowBar.Location = new Point(1, 565);
  724. tomorrowTXT.Location = new Point(1, 571);
  725.  
  726. TDCheck08.Enabled = true;
  727. TDCheck08.Visible = true;
  728. TodayMsg08.Enabled = true;
  729. TodayMsg08.Visible = true;
  730.  
  731. if (tsk.Substring(12, 4) != "9999")
  732. {
  733. TDRemind08.Visible = true;
  734. TDRemind08.Enabled = true;
  735. TDRemind08.Text = "at "
  736. + tsk.Substring(12, 2) + ":"
  737. + tsk.Substring(14, 2);
  738. }
  739.  
  740. todayT08.Enabled = true;
  741. todayT08.Visible = true;
  742. TodayMsg08.Text = tsk.Substring(16);
  743. }
  744. void tdTask09(string tsk)
  745. {
  746. tomorrowBar.Location = new Point(1, 611);
  747. tomorrowTXT.Location = new Point(1, 617);
  748.  
  749. TDCheck09.Enabled = true;
  750. TDCheck09.Visible = true;
  751. TodayMsg09.Enabled = true;
  752. TodayMsg09.Visible = true;
  753.  
  754. if (tsk.Substring(12, 4) != "9999")
  755. {
  756. TDRemind09.Visible = true;
  757. TDRemind09.Enabled = true;
  758. TDRemind09.Text = "at "
  759. + tsk.Substring(12, 2) + ":"
  760. + tsk.Substring(14, 2);
  761. }
  762.  
  763. todayT09.Enabled = true;
  764. todayT09.Visible = true;
  765. TodayMsg09.Text = tsk.Substring(16);
  766. }
  767. void tdTask10(string tsk)
  768. {
  769. tomorrowBar.Location = new Point(1, 655);
  770. tomorrowTXT.Location = new Point(1, 661);
  771.  
  772. TDCheck10.Enabled = true;
  773. TDCheck10.Visible = true;
  774. TodayMsg10.Enabled = true;
  775. TodayMsg10.Visible = true;
  776.  
  777. if (tsk.Substring(12, 4) != "9999")
  778. {
  779. TDRemind10.Visible = true;
  780. TDRemind10.Enabled = true;
  781. TDRemind10.Text = "at "
  782. + tsk.Substring(12, 2) + ":"
  783. + tsk.Substring(14, 2);
  784. }
  785.  
  786. todayT10.Enabled = true;
  787. todayT10.Visible = true;
  788. TodayMsg10.Text = tsk.Substring(16);
  789. }
  790. void tdTaskMore()
  791. {
  792. tomorrowBar.Location = new Point(1, 689);
  793. tomorrowTXT.Location = new Point(1, 695);
  794.  
  795. TodayMore.Enabled = true;
  796. TodayMore.Visible = true;
  797.  
  798. }
  799. private void label1_Click_1(object sender, EventArgs e)
  800. {
  801.  
  802. }
  803.  
  804.  
  805. void showTomorrowList()
  806. {
  807. tomorrowBar.Location = new Point(1, 198);
  808. tomorrowTXT.Location = new Point(1, 204);
  809.  
  810. TDCheck01.Visible = false;
  811. TDCheck02.Visible = false;
  812. TDCheck03.Visible = false;
  813. TDCheck04.Visible = false;
  814. TDCheck05.Visible = false;
  815. TDCheck06.Visible = false;
  816. TDCheck07.Visible = false;
  817. TDCheck08.Visible = false;
  818. TDCheck09.Visible = false;
  819. TDCheck10.Visible = false;
  820.  
  821. todayT01.Visible = false;
  822. todayT02.Visible = false;
  823. todayT03.Visible = false;
  824. todayT04.Visible = false;
  825. todayT05.Visible = false;
  826. todayT06.Visible = false;
  827. todayT07.Visible = false;
  828. todayT08.Visible = false;
  829. todayT09.Visible = false;
  830. todayT10.Visible = false;
  831.  
  832. TodayMsg01.Visible = false;
  833. TodayMsg02.Visible = false;
  834. TodayMsg03.Visible = false;
  835. TodayMsg04.Visible = false;
  836. TodayMsg05.Visible = false;
  837. TodayMsg06.Visible = false;
  838. TodayMsg07.Visible = false;
  839. TodayMsg08.Visible = false;
  840. TodayMsg09.Visible = false;
  841. TodayMsg10.Visible = false;
  842.  
  843. TDRemind01.Visible = false;
  844. TDRemind02.Visible = false;
  845. TDRemind03.Visible = false;
  846. TDRemind04.Visible = false;
  847. TDRemind05.Visible = false;
  848. TDRemind06.Visible = false;
  849. TDRemind07.Visible = false;
  850. TDRemind08.Visible = false;
  851. TDRemind09.Visible = false;
  852. TDRemind10.Visible = false;
  853.  
  854. TodayMore.Visible = false;
  855.  
  856. showTomorrowTsk();
  857.  
  858. TDShow = false;
  859. TMShow = true;
  860.  
  861.  
  862. }
  863.  
  864. void showTomorrowTsk()
  865. {
  866. try
  867. {
  868. int n = 0;
  869. string[] lines = System.IO.File.ReadAllLines(@"C:\tomorrowList.txt");
  870. foreach (string line in lines)
  871. {
  872.  
  873. if (line.Substring(0, 4) == "UNCH")
  874. {
  875. n++;
  876. if (n == 1)
  877. {
  878. tdTask02(line); tmTsk[01] = line;
  879. }
  880. if (n == 2)
  881. {
  882. tdTask03(line); tmTsk[01] = line;
  883. }
  884. if (n == 3)
  885. {
  886. tdTask04(line); tmTsk[01] = line;
  887. }
  888. if (n == 4)
  889. {
  890. tdTask05(line); tmTsk[01] = line;
  891. }
  892. if (n == 5)
  893. {
  894. tdTask06(line); tmTsk[01] = line;
  895. }
  896. if (n == 6)
  897. {
  898. tdTask07(line); tmTsk[01] = line;
  899. }
  900. if (n == 7)
  901. {
  902. tdTask08(line); tmTsk[01] = line;
  903. }
  904. if (n == 8)
  905. {
  906. tdTask09(line); tmTsk[01] = line;
  907. }
  908. if (n == 9)
  909. {
  910. tdTask10(line); tmTsk[01] = line;
  911. }
  912. if (n > 9)
  913. tmTaskMore();
  914. }
  915. }
  916.  
  917. tomorrowBar.Location = new Point(1, 198);
  918. tomorrowTXT.Location = new Point(1, 204);
  919. }
  920. catch
  921. {
  922.  
  923. }
  924.  
  925. }
  926. void tmTaskMore()
  927. {
  928. TomorrowMore.Visible = true;
  929. }
  930.  
  931. private void TDCheck01_CheckedChanged(object sender, EventArgs e)
  932. {
  933. checking(tdTsk[1]);
  934. }
  935.  
  936. void checking(string tsk)
  937. {
  938. MessageBox.Show("GO ON!!");
  939. }
  940. }
  941. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement