Beispiel #1
0
        public static void atualizarForm(Form form)
        {
            UIXHeader hdr = null;

            foreach (Control control in form.Controls)
            {
                if (control is UIXHeader hdrUIX)
                {
                    hdr = hdrUIX;
                    break;
                }
            }
            if (hdr != null)
            {
                AppDesktop.VisualTemplate.frmApply(form, hdr);
            }

            UtilForm.UpdateIndexes(form.Controls);
            if (form.AcceptButton != null)
            {
                definirBotaoConfirmacao(form.Controls, form.AcceptButton);
                form.AcceptButton = null;
            }

            Numboard.ControlNumboard.definirNumBoard(form.Controls);
        }
Beispiel #2
0
        public static void alterarConteudo(Panel pnlConteudo, UserControl uctConteudo, UIXHeader hdr, String titulo)
        {
            if (pnlConteudo.Controls.Count == 1)
            {
                Control controlAnterior = pnlConteudo.Controls[0];
                if (uctConteudo == null || !titulo.Equals(pnlConteudo.AccessibleName))
                {
                    pnlConteudo.Hide();
                    Cursor.Current = Cursors.WaitCursor;

                    controlAnterior.Controls.Clear();
                    controlAnterior.Dispose();
                    pnlConteudo.Controls.Remove(controlAnterior);
                }
                else
                {
                    return;
                }
            }

            pnlConteudo.AccessibleName = titulo;
            hdr.Title = App.Name + " - " + titulo;
            if (uctConteudo == null)
            {
                pnlConteudo.Show();
                Cursor.Current = Cursors.Default;
                return;
            }

            UtilForm.UpdateIndexes(uctConteudo.Controls);
            AppDesktop.VisualTemplate.ctlApply(uctConteudo);

            pnlConteudo.Controls.Add(uctConteudo);
            uctConteudo.Location = new Point(0, 0);
            uctConteudo.Size     = pnlConteudo.Size;

            pnlConteudo.Show();
            Cursor.Current = Cursors.Default;
        }