コード例 #1
0
        private void EspecificaDeGastoUI_Load(object sender, EventArgs e)
        {
            WinForm.pfActiveControl(this, false);
            prcActiveButton(true, false);
            DatosTabla();
            dgvPartidasEspecificas.DefaultCellStyle.ForeColor = Color.Black;
            List <int> listaColumnas = new List <int>()
            {
                2, 2
            };

            Grilla.EsconderColumnas(dgvPartidasEspecificas, listaColumnas);
            string[] cabeceras = { "Partida Específica", "Descripción" };
            Grilla.PonerCabeceraAGrid(dgvPartidasEspecificas, cabeceras);
        }
コード例 #2
0
 private void btnGuardar_Click(object sender, EventArgs e)
 {
     if (Nuevo == true)
     {
         AgregarEspecificaDeGasto();
         WinForm.pfActiveButon(this, true);
         DatosTabla();
         Botones.EstablecerEstadoBotones(listBotones, true);
     }
     else
     {
         ModificarEspecificaDeGasto();
         WinForm.pfActiveButon(this, true);
         DatosTabla();
         Botones.EstablecerEstadoBotones(listBotones, true);
     }
 }
コード例 #3
0
    public override void LoadTestPage()
    {
        Application.targetFrameRate = 60;
#if UNITY_IPHONE || UNITY_ANDROID
        //Scale.DpiScale = true;
#endif
        //UIPage.LoadPage<DrawPage>();
        //UIPage.LoadPage<LayoutTestPage>();
        //UIPage.LoadPage<TestPage>();
        win = new WinForm("tool");
        win.SetCanvas(canvas.transform as RectTransform);
        win.BindingCamera(camera, canvas);
        var page  = win.AddNode("page");
        var model = ModelManagerUI.CloneModel("baseUI", "testpage");
        view = new View();
        ModelManagerUI.LoadToGame(model, view);
        model.SetParent(page);
        view.but.Click = (o, e) => { Debug.Log("click is ok"); };
    }
コード例 #4
0
ファイル: MainForm.cs プロジェクト: AhmedSakrr/UACHelper
        private void ShowGoodies(object sender, EventArgs e)
        {
            DialogResult result;

            if (sender == btn_colorBox)
            {
                result = WinForm.ShieldifyNativeDialog(DialogResult.OK, () => new ColorDialog().ShowDialog());
            }
            else if (sender == btn_saveFileDialog)
            {
                result = WinForm.ShieldifyNativeDialog(DialogResult.OK, () => new SaveFileDialog().ShowDialog());
            }
            else if (sender == btn_openFileDialog)
            {
                result = WinForm.ShieldifyNativeDialog(DialogResult.OK, () => new OpenFileDialog().ShowDialog());
            }
            else if (sender == btn_folderDialog)
            {
                result = WinForm.ShieldifyNativeDialog(DialogResult.OK, () => new FolderBrowserDialog().ShowDialog());
            }
            else if (sender == btn_fontDialog)
            {
                result = WinForm.ShieldifyNativeDialog(DialogResult.OK, () => new FontDialog().ShowDialog());
            }
            else if (sender == btn_customDialog)
            {
                result = new CustomDialog().ShowDialog(DialogResult.No);
            }
            else
            {
                result = WinForm.ShieldifyNativeDialog(DialogResult.Yes,
                                                       () =>
                                                       MessageBox.Show(this, Resources.MainForm_ShowGoodies_MessageBox_Message,
                                                                       Resources.MainForm_ShowGoodies_MessageBox_Caption, MessageBoxButtons.YesNoCancel,
                                                                       MessageBoxIcon.Question));
            }

            MessageBox.Show(string.Format(Resources.MainForm_ShowGoodies_Result_Message, result),
                            Resources.MainForm_ShowGoodies_Result_Caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
コード例 #5
0
    static void Main(string[] args)
    {
		FreeConsole();
        WinForm myFrm = new WinForm();

        // Create Button and TextBox objects
        myFrm.button1 = new System.Windows.Forms.Button();
        myFrm.textBox1 = new System.Windows.Forms.TextBox();

        // Setting the Button control Properties
        myFrm.button1.BackColor = System.Drawing.Color.Blue;
        myFrm.button1.ForeColor = System.Drawing.Color.Yellow;
        myFrm.button1.Location = new System.Drawing.Point(24, 40);
        myFrm.button1.Name = "button1";
        myFrm.button1.Size = new System.Drawing.Size(112, 32);
        myFrm.button1.TabIndex = 0;
        myFrm.button1.Text = "Click Me";

        // The button click event handler
        myFrm.button1.Click += new
        System.EventHandler(myFrm.button1_Click);

        // Setting the TextBox control Properties
        myFrm.textBox1.Location = new System.Drawing.Point(168, 48);
        myFrm.textBox1.Name = "textBox1";
        myFrm.textBox1.Size = new System.Drawing.Size(104, 20);
        myFrm.textBox1.TabIndex = 1;
        myFrm.textBox1.Text = "textBox1";

        // Setting the form Properties
        myFrm.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
        myFrm.ClientSize = new System.Drawing.Size(292, 273);
        myFrm.Controls.AddRange(new System.Windows.Forms.Control[] { myFrm.textBox1, myFrm.button1 });
        myFrm.Text = "My First Windows Application";
        myFrm.BackColor = Color.Red;
        myFrm.ForeColor = Color.Yellow;
        myFrm.ResumeLayout(false);
        Application.Run(myFrm);
    }
コード例 #6
0
        private static void Main(string[] args)
        {
            var winForm = new WinForm("WINDOW窗口");

            winForm.AddComponent(new Picture("LOGO图片"));
            winForm.AddComponent(new Button("登陆"));
            winForm.AddComponent(new Button("注册"));

            var frame = new Frame("FRAME1");

            frame.AddComponent(new Label("用户名"));
            frame.AddComponent(new TextBox("文本框"));
            frame.AddComponent(new Label("密码"));
            frame.AddComponent(new PasswordBox("密码框"));
            frame.AddComponent(new CheckBox("复选框"));
            frame.AddComponent(new TextBox("记住用户名"));
            frame.AddComponent(new LinkLabel("忘记密码"));

            winForm.AddComponent(frame);

            winForm.Draw();
        }
コード例 #7
0
 /// <summary>
 /// 关闭已经不存在的文件 的PAGE
 /// </summary>
 public void RemoveInvalidTab()
 {
     try
     {
         if (document1 != null && !DesignMode && tabControl1.TabCount > 0)
         {
             for (int i = 0; i < tabControl1.TabCount; i++)
             {
                 Document doc = ((Document)WinForm.FindControl(tabControl1.TabPages[i], "document1"));
                 if (doc != null)
                 {
                     string file = doc.FullFileName;
                     if (!File.Exists(file))
                     {
                         tabControl1.TabPages.RemoveAt(i);
                     }
                 }
             }
         }
     }
     catch { }
 }
コード例 #8
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("¿Guardar el Registro?", "Control Presupuestal", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
            {
                ControlPresupuestal_VO pControlPresupuestal = new ControlPresupuestal_VO();
                pControlPresupuestal = this.prcGetControlPresupuestal();

                DataTable DtDetalleControlPresupuestal = new DataTable();
                DtDetalleControlPresupuestal = this.prcGetDetalleControlPresupuestal();

                if (Nuevo == true)
                {
                    if (new ControlPresupuestal_BUS().Insert_ControlPresupuestal(ref pControlPresupuestal, DtDetalleControlPresupuestal))
                    {
                        this.txtId.Text = pControlPresupuestal.CPRE_INT_IDCONTROLPRESUPUESTAL.ToString();
                        prcCargaControlPrespuestal();
                    }
                    else
                    {
                        MessageBox.Show("Error al guardar Registro");
                    }
                }
                else
                {
                    if (new ControlPresupuestal_BUS().Update_ControlPresupuestal(pControlPresupuestal, DtDetalleControlPresupuestal))
                    {
                        prcCargaControlPrespuestal();
                    }
                    else
                    {
                        MessageBox.Show("Error al guardar Registro");
                    }
                }
                WinForm.pfActiveControl(this, false);
                prcActiveButton(true, true);
                this.dgvControlPresupuestal.Enabled = true;
            }
        }
コード例 #9
0
        // UAC Helper Class GitHub Doc
        // https://github.com/falahati/UACHelper
        public void ElevatedDialogSwitcher()
        {
            DialogResult result = WinForm.ShieldifyNativeDialog(DialogResult.Yes, () =>
                                                                MessageBox.Show(this, WinControlTool.Properties.Resources.ProgramWithoutAdministratorRights,
                                                                                WinControlTool.Properties.Resources.WithoutAdminRights, MessageBoxButtons.YesNo,
                                                                                MessageBoxIcon.Information));

            switch (result)
            {
            case DialogResult.Yes:
                RestartWithElevatedRights();
                break;

            case DialogResult.No:
            case DialogResult.None:
                this.Show();
                AddUACShieldToControls();
                break;

            default:
                break;
            }
        }
コード例 #10
0
        private void button3_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog();

            if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
            {
                string         selectedPath   = folderBrowserDialog.SelectedPath;
                SaveFileDialog saveFileDialog = new SaveFileDialog();
                saveFileDialog.AddExtension = true;
                saveFileDialog.Filter       = "DLL文件(*.dll)|*.dll";
                if (saveFileDialog.ShowDialog() == DialogResult.OK)
                {
                    string     fileName   = saveFileDialog.FileName;
                    CsComplier csComplier = new CsComplier();
                    csComplier.path   = selectedPath;
                    csComplier.target = fileName;
                    csComplier.@using = new string[]
                    {
                        "System.Drawing.dll",
                        "Game.Logic.dll",
                        "Bussiness.dll",
                        "SqlDataProvider.dll",
                        "Game.Base.dll"
                    };
                    string text = "";
                    if (csComplier.Complie(ref text))
                    {
                        WinForm.Notice("Complied");
                    }
                    else
                    {
                        WinForm.Notice("Failed");
                    }
                    this.textBox1.AppendText(text);
                }
            }
        }
コード例 #11
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("¿Guardar el Registro?", "Meta EspecificoDeGasto", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
            {
                MetaEspecificoDeGasto_VO pMetaEspecificoDeGasto = new MetaEspecificoDeGasto_VO();
                pMetaEspecificoDeGasto = this.prcGetMetaEspecificoDeGasto();

                if (Nuevo == true)
                {
                    if (new MetaEspecificoDeGasto_BUS().Insert_MetaEspecificoDeGasto(pMetaEspecificoDeGasto))
                    {
                        WinForm.pfActiveButon(this, true);
                        prcList_MetaEspecificoDeGasto();
                    }
                    else
                    {
                        MessageBox.Show("Error al guardar Registro");
                    }
                }
                else
                {
                    if (new MetaEspecificoDeGasto_BUS().Update_MetaEspecificoDeGasto(pMetaEspecificoDeGasto))
                    {
                        WinForm.pfActiveButon(this, true);
                        prcList_MetaEspecificoDeGasto();
                    }
                    else
                    {
                        MessageBox.Show("Error al guardar Registro");
                    }
                }
                WinForm.pfActiveControl(this, false);
                prcActiveButton(true, true);
                this.dgvGastoEspecifico.Enabled = true;
            }
        }
コード例 #12
0
 private void CloseWinForm()
 {
   if (_winForm != null)
   {
     // Close Windows Forms window.
     _winForm.FormClosing -= OnWindowClosing;  // Remove Closing event handler. (Otherwise, the event would exit the game.)
     _winForm.Close();
     _winForm = null;
   }
 }
コード例 #13
0
    private void OpenWinForm()
    {
      // Create a new Windows Forms window.
      _winForm = new WinForm { GraphicsServices = _graphicsManager };

      // Optional: When the window closes, we want to exit the application.
      _winForm.FormClosing += OnWindowClosing;

      // Make the window visible.
      _winForm.Show();
    }
コード例 #14
0
ファイル: Loading.cs プロジェクト: SkelletonX/DDTServer
        private void Init(Object sender, EventArgs e)
        {
            LogProvider.Default = new LogProvider(new LogConfig
            {
                UseMessageBox = true,
                LogView       = LogView,
                UseLogView    = true,
                FilePath      = @".\log\",
                UseFile       = true
            });
            var log = LogProvider.Default;

            this.runmgr = new RunMgr();
            Web.Server.WebServer.Runmgr = this.runmgr;

            new Thread(() =>
            {
                if (!Sql_DbObject.TryConnection())
                {
                    log.Error("Fail to connect to SQL!");
                    WinForm.Notice("初始化失败,请查看日志。");
                    return;
                }
                else
                {
                    log.Info("Succeed to to connect to SQL!");
                }
                if (!LanguageMgr.Load())
                {
                    log.Error("Fail to load language");
                    WinForm.Notice("初始化失败,请查看日志。");
                    return;
                }
                else
                {
                    log.Info("Succeed to load language");
                }
                if (!MapMgr.Init())
                {
                    log.Error("Fail to load map");
                    WinForm.Notice("初始化失败,请查看日志。");
                    return;
                }
                else
                {
                    log.Info("Succeed to load map");
                }
                if (!ItemMgr.Init())
                {
                    log.Error("Fail to load item");
                    WinForm.Notice("初始化失败,请查看日志。");
                    return;
                }
                else
                {
                    log.Info("Succeed to load item");
                }
                if (!PropItemMgr.Init())
                {
                    log.Error("Fail to load propitem");
                    WinForm.Notice("初始化失败,请查看日志。");
                    return;
                }
                else
                {
                    log.Info("Succeed to load propitem");
                }
                if (!BallMgr.Init())
                {
                    log.Error("Fail to load ball");
                    WinForm.Notice("初始化失败,请查看日志。");
                    return;
                }
                else
                {
                    log.Info("Succeed to load ball");
                }
                if (!DropMgr.Init())
                {
                    log.Error("Fail to load drop");
                    WinForm.Notice("初始化失败,请查看日志。");
                    return;
                }
                else
                {
                    log.Info("Succeed to load drop");
                }
                if (!NPCInfoMgr.Init())
                {
                    log.Error("Fail to load npc");
                    WinForm.Notice("初始化失败,请查看日志。");
                    return;
                }
                else
                {
                    log.Info("Succeed to load npc");
                }

                if (!ItemBoxMgr.Init())
                {
                    log.Error("Fail to load itembox");
                    WinForm.Notice("初始化失败,请查看日志。");
                    return;
                }
                else
                {
                    log.Info("Succeed to load itembox");
                }
                flag = true;
            }).Start();

            Thread thread = new Thread(run);

            thread.Start();
        }
コード例 #15
0
ファイル: MainForm.cs プロジェクト: smartree/Zydeo
 /// <summary>
 /// Handles user's action to close and update.
 /// </summary>
 private void updateNow()
 {
     updateAfterClose = true;
     WinForm.Close();
 }
コード例 #16
0
 private void btnCancelar_Click(object sender, EventArgs e)
 {
     WinForm.pfCleanTextBox(this);
     WinForm.pfActiveButon(this, false);
     Botones.EstablecerEstadoBotones(listBotones, true);
 }
コード例 #17
0
 private void btnModificar_Click(object sender, EventArgs e)
 {
     Nuevo = false;
     WinForm.pfActiveControl(this, true);
     Botones.EstablecerEstadoBotones(listBotones, false);
 }
コード例 #18
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     if (progressBar1.Value == 0)
     {
         timer1.Stop(); MessageBox.Show(" Sorry you lost !"); this.Close();
     }
     if (progressBar2.Value == 0)
     {
         timer1.Stop();
         WinForm wi = new WinForm(currentLevel.BadgeImg,currentLevel.CoinsRewards,currentLevel.PoinatNePoiminat);
         currentLevel.PoinatNePoiminat = true;
         igrac.Money += currentLevel.CoinsRewards;
         wi.ShowDialog();
         this.Close();
     }
 }
コード例 #19
0
ファイル: Main.cs プロジェクト: andrejpanic/win-mobile-code
		public static void Main (string[] args)
		{
			WinForm form = new WinForm ();
			Application.Run (form);
			//Console.WriteLine("Hello World!");
		}
コード例 #20
0
ファイル: MoveTriangle.cs プロジェクト: JeremiahZhang/AKA
 static void Main()
 {
     using (WinForm our_directx_form = new WinForm())
     {
         our_directx_form.InitializeDevice();
         our_directx_form.CameraPositioning();
         our_directx_form.VertexDeclaration();
         our_directx_form.InitializeKeyboard();
         Application.Run(our_directx_form);
     }
 }
コード例 #21
0
 private void btnModificar_Click(object sender, EventArgs e)
 {
     Nuevo = false;
     WinForm.pfActiveControl(this, true);
     prcActiveButton(false, false);
 }
コード例 #22
0
 private void checkWinner()
 {
     if (this.world.checkWinner())
     {
         WinForm myForm = new WinForm();
         myForm.Show();
     }
 }
コード例 #23
0
 private void splitContainer2_SplitterMoved(object sender, SplitterEventArgs e)
 {
     WinForm.RemoveFocus(this);
 }