// ---- Window control function's - END
 // ---- MAIN WINDOW FUNC - START
 public MainWindow()
 {
     InitializeComponent();
     instance = this;
     combo1.SelectionChanged += new SelectionChangedEventHandler(comboBox1SelectionChanged);
     combobox_exp_books.SelectionChanged += new SelectionChangedEventHandler(comboBox2SelectionChanged);
     combobox_warehouse_select.SelectionChanged +=new SelectionChangedEventHandler(combobox_warehouse_loc_select_SelectionChanged);
     txtbox_client_surr.PreviewTextInput += new TextCompositionEventHandler(textBox_PreviewTextInput);
     txt_box_client_name.PreviewTextInput += new TextCompositionEventHandler(textBox_PreviewTextInput);
 }
        private const int SPLASH_FADE_TIME = 500; // Miliseconds

        #endregion Fields

        #region Methods

        protected override void OnStartup(StartupEventArgs e)
        {
            // Step 1 - Load the splash screen
            SplashScreen splash = new SplashScreen("bs2_Images/splash.png");
            splash.Show(false, true);

            // Step 2 - Start a stop watch
            Stopwatch timer = new Stopwatch();
            timer.Start();

            // Step 3 - Load your windows but don't show it yet
            base.OnStartup(e);
            MainWindow main = new MainWindow();

            // Step 4 - Make sure that the splash screen lasts at least 2.5 seconds
            timer.Stop();
            int remainingTimeToShowSplash = MINIMUM_SPLASH_TIME - (int)timer.ElapsedMilliseconds;
            if (remainingTimeToShowSplash > 0)
                Thread.Sleep(remainingTimeToShowSplash);

            // Step 5 - show the page
            splash.Close(TimeSpan.FromMilliseconds(SPLASH_FADE_TIME));
            main.Show();
        }