using System; using System.Collections.Generic; using System.Windows.Forms; using System.IO; using System.Text.Json; namespace AssistDB { public partial class SplashScreen : Form { public SplashScreen() { InitializeComponent(); } Timer tmr; private void SplashScreen_Shown(object sender, EventArgs e) { tmr = new Timer(); //set time interval 3 sec tmr.Interval = 3000; //starts the timer tmr.Start(); tmr.Tick += tmr_Tick; } void tmr_Tick(object sender, EventArgs e) { var path = System.IO.Path.Combine(Application.StartupPath, @"Sources\tableSchema.json"); List jsonFile = JsonSerializer.Deserialize>(File.ReadAllText(path)); AssitDB assit = new AssitDB(jsonFile); //after 3 sec stop the timer tmr.Stop(); //display mainform assit.Show(); //hide this form this.Hide(); } } }