Пример #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            MenuPrincipal vista = new MenuPrincipal();

            try
            {
                Application.Run(vista);
            }
            catch (Exception ex)
            {
                UtilitarioExcepcion.MostrarExcepcion(vista, ex);
            }
        }
Пример #2
0
        private void DibujarDiagrama()
        {
            try
            {
                if (graphics == null)
                {
                    graphics = panelDiagrama.CreateGraphics();
                }

                if (graphicsTooltip == null)
                {
                    graphicsTooltip = panelDiagrama.CreateGraphics();
                    estadoVacio     = graphicsTooltip.Save();
                }

                Point punto = new Point(-panelDiagrama.HorizontalScroll.Value, -panelDiagrama.VerticalScroll.Value);

                if (panelDiagrama.Controls.Count == 0)
                {
                    Panel panel = new Panel()
                    {
                        AutoSize = false,
                        Location = diagramaSecuencia.EndPoint,
                        Width    = 100,
                        Height   = 100
                    };
                    panel.BackColor = Color.Transparent;
                    panelDiagrama.Controls.Add(panel);
                }

                graphics.Clear(Color.White);
                diagramaSecuencia.Dibujar(graphics, punto);
            }
            catch (Exception ex)
            {
                UtilitarioExcepcion.MostrarExcepcion(this, ex);
            }
        }