private void updatetimer_Tick(object sender, EventArgs e) { bool windowopen; using (WebClient wc = new WebClient()) { string newURL = Form1.jsonURL; var newjson = string.Empty; frmPopup frmpop = new frmPopup(); try { newjson = wc.DownloadString(newURL.ToString()); windowopen = FormIsOpen(Application.OpenForms, typeof(frmPopup)); } catch (WebException ex) { windowopen = FormIsOpen(Application.OpenForms, typeof(frmPopup)); if (windowopen == false) { frmpop.Show(); } Console.WriteLine($"{ex}"); } if (windowopen) { frmpop.Hide(); } var newlist = (JsonConvert.DeserializeObject <List <JSONModel> >(newjson)); if (newlist != null) { datalist.AddRange(newlist); } } chart1.DataBind(); processTick(); }