Esempio n. 1
0
        /// <summary>
        /// Override of Form.Show(IWin32Window owner) Method. Caters for singleton Forms. Does not actually display the form.
        /// </summary>
        /// <param name="owner">Any object that implements <see cref="IWin32Window" /> and represents the top-level window that will own this Form. </param>
        public void ShowInvisible(IWin32Window owner)
        {
            Form OpenScreen = TFormsList.GFormsList[this.GetType().FullName];
            bool OpenSelf   = true;

            if ((OpenScreen != null) &&
                (OpenScreen.Modal != true))
            {
                if (TFormsList.GSingletonForms.Contains(this.GetType().Name))
                {
//                      MessageBox.Show("Activating singleton screen of Type '" + this.GetType().FullName + "'.");

                    OpenSelf     = false;
                    this.Visible = false;       // needed as this.Close() would otherwise bring this Form to the foreground and OpenScreen.BringToFront() would not help...
                    this.Close();
                }
            }

            if (OpenSelf)
            {
                // add Form to TFormsList.GFormsList but do not show it
                FPetraUtilsObject.TFrmPetra_Load(this, null);

                // removing this event stops the above command be called when the Form is eventually shown
                this.Load -= new System.EventHandler(this.TFrmPetra_Load);
            }
        }
        /*  Form event handlers
         *
         */

        void TGLRevaluation_Load(object sender, EventArgs e)
        {
            // Do intial sizing
            TGLRevaluation_Resize(null, null);

            // Set the initial window position if we have stored it.
            FPetraUtilsObject.TFrmPetra_Load(sender, e);
        }
        private void TUC_Application_Field_Load(object sender, EventArgs e)
        {
            FPetraUtilsObject.TFrmPetra_Load(sender, e);

            tabApplicationField.SelectedIndex = standardTabIndex;
            //TabSelectionChanged(null, null);
            tabApplicationField.Selecting += new TabControlCancelEventHandler(TabSelectionChanging);
        }
Esempio n. 4
0
        private void TFrmGLBatch_Load(object sender, EventArgs e)
        {
            FPetraUtilsObject.TFrmPetra_Load(sender, e);

            tabGLBatch.SelectedIndex = FStandardTabIndex;
            TabSelectionChanged(null, null);

            this.Shown += delegate
            {
                // This will ensure the grid gets the focus when the screen is shown for the first time
                ucoBatches.SetInitialFocus();
            };
        }
Esempio n. 5
0
        private void TFrmGiftBatch_Load(object sender, EventArgs e)
        {
            FPetraUtilsObject.TFrmPetra_Load(sender, e);

            tabGiftBatch.SelectedIndex = standardTabIndex;
            TabSelectionChanged(null, null); //tabGiftBatch.Selecting += new TabControlCancelEventHandler(TabSelectionChanging);

            this.Shown += delegate
            {
                // This will ensure the grid gets the focus when the screen is shown for the first time
                ucoBatches.SetInitialFocus();
            };
        }