コード例 #1
0
        public void AddScreenshot(Image Screenshot)
        {
            try
            {
                PictureBox nPB = new PictureBox();
                nPB.MouseDown += pbScreenshot_MouseDown;

                nPB.Parent = flpScreenshots;
                nPB.SizeMode = PictureBoxSizeMode.StretchImage;
                nPB.BorderStyle = BorderStyle.FixedSingle;
                nPB.ContextMenuStrip = cMenScreenshot;
                nPB.Image = Screenshot;
                nPB.Size = new Size(100, 100); //New Size((Screenshot.Width / 100) * 20, (Screenshot.Height / 100) * 20)
                nPB.Show();

                Button nBtn = new Button();
                nBtn.Click += btnCloseScreenshot_Click;

                nBtn.Parent = nPB;
                nBtn.FlatStyle = FlatStyle.Flat;
                nBtn.Text = "×";
                nBtn.Size = new Size(22, 22);
                nBtn.Location = new Point(nPB.Width - nBtn.Width, -1);
                nBtn.Show();

                Show(frmMain.Default.pnlDock);
            }
            catch (Exception ex)
            {
                Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "AddScreenshot (UI.Window.ScreenshotManager) failed" + Environment.NewLine + ex.Message, true);
            }
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: csoty/SimpleTCPChat
 private void bt_connect_Click(object sender, EventArgs e)
 {
     string serverip = Interaction.InputBox("Type in the IP where you want to join.", "Connect to a server", "csoty.ddns.net");
     if (serverip.Length > 0)
     {
         try
         {
             clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
             IPAddress ipAddress = Dns.GetHostEntry(serverip).AddressList[0];
             IPEndPoint ipEndPoint = new IPEndPoint(ipAddress, 3333);
             clientSocket.BeginConnect(ipEndPoint, new AsyncCallback(OnConnect), clientSocket);
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.ToString());
         }
         
         tBox_msg.Enabled = true;
         bt_send.Enabled = true;
         Button bt_dc = new Button();
         bt_dc.Text = "Disconnect";
         bt_dc.Top = bt_connect.Top + bt_connect.Height + 5;
         bt_dc.Left = bt_connect.Left;
         bt_dc.Click += new EventHandler(bt_dc_Click);
         this.Controls.Add(bt_dc);
         bt_dc.Show();
         lb_constatus.Text = "Connected";
         lb_ip.Text = Dns.GetHostEntry(serverip).AddressList[0].ToString();
         lb_constatus.ForeColor = lb_ip.ForeColor = Color.Green;
     }
 }
コード例 #3
0
ファイル: mulChoice_form.cs プロジェクト: bxdaze/bxdaze
 private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar != '\0')
     {
         Chocie_up.Show();
         //Chocie_finish.Show();
     }
 }
コード例 #4
0
ファイル: NewMapDlg.cs プロジェクト: kg/XnaMannux
        public NewMapDlg()
            : base()
        {
            FormBorderStyle = FormBorderStyle.FixedDialog;

            Label t = new Label();
            t.Text = "Width";
            t.Location = new Point(10, 10);
            t.Show();

            Label u = new Label();
            u.Text = "Height";
            u.Location = new Point(t.Left, t.Bottom + 5);
            u.Show();

            widthbox = new TextBox();
            widthbox.Location = new Point(t.Right + 5, 10);
            widthbox.Show();

            heightbox = new TextBox();
            heightbox.Location = new Point(widthbox.Left, widthbox.Bottom + 5);
            heightbox.Show();

            Button okbutton = new Button();
            okbutton.Text = "OK";
            okbutton.DialogResult = DialogResult.OK;
            okbutton.Location = new Point(t.Left, u.Bottom + 5);
            okbutton.Show();

            Button cancelbutton = new Button();
            cancelbutton.Text = "Cancel";
            cancelbutton.DialogResult = DialogResult.Cancel;
            cancelbutton.Location = new Point(okbutton.Right + 5, okbutton.Top);
            cancelbutton.Show();

            Controls.Add(t);
            Controls.Add(u);
            Controls.Add(widthbox);
            Controls.Add(heightbox);
            Controls.Add(okbutton);
            Controls.Add(cancelbutton);

            AcceptButton = okbutton;
            CancelButton = cancelbutton;

            Width = heightbox.Right + 35;
            Height = okbutton.Bottom + 35;
        }
コード例 #5
0
ファイル: About.cs プロジェクト: prezz/Fuzzy-Gammon
        public AboutGUI()
        {
            this.Width = 415;
            this.Height = 345;
            this.Text = "About";
            this.FormBorderStyle = FormBorderStyle.FixedSingle;
            this.StartPosition = FormStartPosition.CenterParent;
            this.ControlBox = false;

            Panel frame = new Panel();
            frame.BorderStyle = BorderStyle.FixedSingle;
            frame.Left = 15;
            frame.Width = 380;
            frame.Top = 15;
            frame.Height = 258;
            frame.Show();
            this.Controls.Add( frame );

            Label about = new Label();
            //about.BackColor = System.Drawing.Color.Green;
            about.Left = 2;
            about.Width = frame.Width - 4;
            about.Top = 2;
            about.Height = frame.Height - 4;
            about.Show();
            frame.Controls.Add( about );

            string a = "";

            a += "This backgammon program is freeware and has been part of a Master thesis on intelligent game agents. The original program and its associated paper were composed by Mikael Heinze at Aalborg University Esbjerg in Denmark in the period 2nd February to 21st December 2004.\n\n";

            a += "The programs purpose was to work as a problem/test domain for an adaptive and intelligent computer player named Fuzzeval based on fuzzy logic and fuzzy control. For evaluation purpose other computer players based on other principles has also been implemented. To configure an opponent (agent) one can select what decision module that is to be used for move and cube evaluation.\n\n";

            a += "This is however a greatly improved version of this original backgammon program completed at the 26th of April 2005. This version includes a large range of new features, improvements and bug fixes. Examples are a stronger computer opponent named TD-NN 2 and implementation of the cube. It is however only the two TD-NN evaluators that in reality supports cube handling.\n\n";

            a += "Happy playing.";

            about.Text = a;

            Button ok = new Button();
            ok.Text = "OK";
            ok.Left = 320;
            ok.Top = 280;
            ok.Click += new EventHandler(ok_Click);
            ok.Show();
            this.Controls.Add( ok );
        }
コード例 #6
0
        protected virtual void ShowButtons()
        {
            if (minimized)
            {
                return;
            }

            if (!currentErrorIsFirstError)
            {
                btnLeft.Hide();
                btnMiddle.Hide();
                btnRight.Hide();
            }
            else if (currentMessage != null)
            {
                // left button text
                if (currentMessage.BtnList.Left == ErrorButton.NoButton)
                {
                    btnLeft.Hide();
                }
                else
                {
                    btnLeft.Text = currentMessage.BtnList.Left.ToString();
                    btnLeft.Show();
                }
                // middle button text
                if (currentMessage.BtnList.Middle == ErrorButton.NoButton)
                {
                    btnMiddle.Hide();
                }
                else
                {
                    btnMiddle.Text = currentMessage.BtnList.Middle.ToString();
                    btnMiddle.Show();
                }
                // right button text
                if (currentMessage.BtnList.Right == ErrorButton.NoButton)
                {
                    btnRight.Hide();
                }
                else
                {
                    btnRight.Text = currentMessage.BtnList.Right.ToString();
                    btnRight.Show();
                }
            }
        }
コード例 #7
0
ファイル: Form1_client.cs プロジェクト: csoty/SimpleTCPChat
        private void bt_connect_Click(object sender, EventArgs e)
        {
            string serverip = Interaction.InputBox("Type in the IP where you want to join.", "Connect to a server", "csoty.ddns.net");
            if (serverip.Length > 0)
            {
                try
                {
                    clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
                    IPAddress ipAddress = Dns.GetHostEntry(serverip).AddressList[0];
                    IPEndPoint ipEndPoint = new IPEndPoint(ipAddress, 3333);
                    clientSocket.BeginConnect(ipEndPoint, new AsyncCallback(OnConnect), null);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
                
                tBox_msg.Enabled = true;
                bt_send.Enabled = true;
                Button bt_dc = new Button();
                bt_dc.Text = "Disconnect";
                bt_dc.Top = bt_connect.Top + bt_connect.Height + 5;
                bt_dc.Left = bt_connect.Left;
                bt_dc.Click += new EventHandler(bt_dc_Click);
                this.Controls.Add(bt_dc);
                bt_dc.Show();

                try
                {

                    Data sendMsg = new Data();
                    sendMsg.cmd = Command.List;
                    sendMsg.user = user;
                    sendMsg.Msg = null;

                    byteData = sendMsg.toByte();

                    clientSocket.BeginReceive(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnRecieve), null);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
        }
コード例 #8
0
        void cancelarEditar(object sender, EventArgs e)
        {
            // Elementos ocultar
            RBeditar.Show();
            RBeliminar.Show();
            RBmostrar.Show();

            lbContenidoTitulo.Show();
            lbContenido.Show();
            btnTrabajarPublicaciones.Show();
            listaPublicaciones.Show();

            //Mostrados
            txtTituloUpdate.Hide();

            btnGuardarEdicion.Hide();
            btnCancelar.Hide();
            btnAgregar.Hide();
        }
コード例 #9
0
ファイル: SeedSelector.cs プロジェクト: prezz/Fuzzy-Gammon
        public SeedSelector()
        {
            this.Width = 160;
            this.Height = 190;
            this.Text = "Set dice seed";
            this.FormBorderStyle = FormBorderStyle.FixedSingle;
            this.StartPosition = FormStartPosition.CenterParent;
            this.ControlBox = false;

            m_Random = new CheckBox();
            m_Random.Text = "Random";
            m_Random.Checked = true;
            m_Random.Top = 20;
            m_Random.Left = 20;
            m_Random.CheckedChanged += new EventHandler(m_UseSeed_CheckedChanged);
            this.Controls.Add( m_Random );

            Label seedLabel = new Label();
            seedLabel.Text = "Seed value";
            seedLabel.AutoSize = true;
            seedLabel.Top = 60;
            seedLabel.Left = 18;
            this.Controls.Add( seedLabel );

            m_Seed = new NumericUpDown();
            m_Seed.Maximum = 2147483647;
            m_Seed.Minimum = 0;
            m_Seed.Value = new Random().Next( 0, 2147483647 );
            m_Seed.Enabled = false;
            m_Seed.Top = 78;
            m_Seed.Left = 18;
            m_Seed.Leave += new EventHandler(m_Seed_Leave);
            m_Seed.KeyPress += new KeyPressEventHandler(m_Seed_KeyPress);
            this.Controls.Add( m_Seed );

            Button ok = new Button();
            ok.Text = "OK";
            ok.Left = 38;
            ok.Top = 118;
            ok.Click += new EventHandler(ok_Click);
            ok.Show();
            this.Controls.Add( ok );
        }
コード例 #10
0
ファイル: TimelinePanel.cs プロジェクト: wshanshan/DDD
        public void AddTimelineTrack(string name)
        {
            if (!_timeline_tracks.ContainsKey(name))
            {
                Button b = new Button();
                b.Height = TickHeight;
                TrackPanel.VerticalScroll.SmallChange = TickHeight;
                TrackPanel.VerticalScroll.LargeChange = TickHeight;
                b.Text = name;
                b.MouseClick += new MouseEventHandler(this.TimelineTrackClicked);
                b.TextAlign = ContentAlignment.MiddleCenter;
                b.Parent = TrackPanel;
                b.Dock = DockStyle.Top;
                b.BringToFront();
                b.Show();

                _timeline_tracks.Add(b.Text, new EventTimeline(b.Text, b, new SortedDictionary<int, RectangleF>()));
                SelectTimelineTrack(name);
            }
            else
            {
                MessageBox.Show("The requested Track exists already.", "Error adding Timeline Track", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
コード例 #11
0
        void TrabajarConEncuesta(object sender, EventArgs e)
        {
            if (RBeditar.Checked == false && RBeliminar.Checked == false && RBmostrar.Checked == false)
            {
                MessageBox.Show("Debe seleccionar una opcion");
            }
            else
            {
                if (listaPublicaciones.SelectedRows.Count > 0 && RBeliminar.Checked == true)
                {
                    int filaSeleccionada = listaPublicaciones.CurrentRow.Index;

                    usuarioNL usuarioNL = new usuarioNL();
                    usuarioNL.borrarPublicacion(valor);
                    listaPublicaciones.Columns.Clear();
                    listaPublicaciones.DataSource = "";
                    CargarEncuesta();

                    MessageBox.Show("Eliminar!!!");
                }

                else if (listaPublicaciones.SelectedRows.Count > 0 && RBeditar.Checked == true)
                {
                    int filaSeleccionada = listaPublicaciones.CurrentRow.Index;

                    usuarioNL nl = new usuarioNL();

                    // Elementos ocultar
                    RBeditar.Hide();
                    RBeliminar.Hide();
                    RBmostrar.Hide();

                    lbContenidoTitulo.Hide();
                    lbContenido.Hide();
                    btnTrabajarPublicaciones.Hide();
                    listaPublicaciones.Hide();
                    btnAgregar.Hide();

                    //Mostrados
                    txtTituloUpdate.Show();
                    txtTituloUpdate.Text  = nl.CargarDataPublicacion(valor).titulo.ToString();
                    txtContenido.ReadOnly = false;

                    btnGuardarEdicion.Show();
                    btnCancelar.Show();
                }

                else if (listaPublicaciones.SelectedRows.Count > 0 && RBmostrar.Checked == true)
                {
                    int filaSeleccionada = listaPublicaciones.CurrentRow.Index;


                    usuarioNL nl = new usuarioNL();

                    lbContenidoFecha.Text    = "";
                    lbContenidoFecha.Text    = nl.CargarDataPublicacion(valor).fecha.ToString();
                    lbContenidoFecha.Visible = true;

                    lbContenidoTitulo.Text    = "";
                    lbContenidoTitulo.Text    = nl.CargarDataPublicacion(valor).titulo.ToString();
                    lbContenidoTitulo.Visible = true;

                    txtContenido.Text = "";
                    txtContenido.Text = nl.CargarDataPublicacion(valor).contenido.ToString();

                    RBeditar.Visible = true;
                }

                else
                {
                    MessageBox.Show("Debe seleccionar la columna pulsando en la columna a la izquierda del todo");
                }
            }
        }
コード例 #12
0
        /// <summary>
        /// Shows the player's score, whether they win/lose, and the top 10 on the leaderboard for the current level.
        /// </summary>
        /// <param name="sender">Reference to method that calls this event</param>
        /// <param name="e"></param>
        public void results(object sender, EventArgs e)
        {
            game.hideGameControls();

            int x         = gameMain.ActiveForm.Width;
            int x_textbox = 0;
            int x_button  = 0;
            int x_win     = 0;


            //Creates a panel for results of the game to show
            panel_results           = new Panel();
            panel_results.Dock      = System.Windows.Forms.DockStyle.Fill;
            panel_results.Location  = new System.Drawing.Point(0, 0);
            panel_results.Size      = new System.Drawing.Size(gameMain.ActiveForm.Width, gameMain.ActiveForm.Height);//THROWS ERROR EXCEPTION
            panel_results.Visible   = true;
            panel_results.BackColor = Color.AntiqueWhite;

            //Creates a label for player's final score
            label_score           = new Label();
            label_score.AutoSize  = true;
            label_score.BackColor = System.Drawing.Color.Transparent;
            label_score.Text      = "Score: " + gamePlay.score.ToString();
            label_score.Font      = new System.Drawing.Font("Comic Sans MS", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            label_score.Location  = new System.Drawing.Point(0, 0);//66, 114
            label_score.Name      = "label_score";
            label_score.Visible   = true;


            //Indicates whether the player reached the needed score to move on
            label_win_lose           = new Label();
            label_win_lose.AutoSize  = true;
            label_win_lose.BackColor = System.Drawing.Color.Transparent;
            label_win_lose.Font      = new System.Drawing.Font("Comic Sans MS", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            label_win_lose.ForeColor = System.Drawing.Color.Red;
            //x_win = ((x/2) - (label_win_lose.Width/2));
            label_win_lose.Location  = new System.Drawing.Point(212, 100);
            label_win_lose.Name      = "label_win_lose";
            this.label_win_lose.Size = new System.Drawing.Size(286, 86);


            //Creates a button for the player to return the game modes page
            button_return          = new Button();
            button_return.AutoSize = true;
            button_return.Size     = new System.Drawing.Size(100, 50); //200, 100
            button_return.Location = new Point(100, 650);              //100, 400
            button_return.Text     = "Return";
            button_return.Font     = new System.Drawing.Font("Comic Sans MS", 26F, FontStyle.Bold);
            button_return.Click   += new EventHandler(button_start_Click);

            //Creates a button for the player to move onto the next levels
            button_continue          = new Button();
            button_continue.AutoSize = true;
            button_continue.Size     = new System.Drawing.Size(100, 50); //200, 100
            button_continue.Location = new Point(400, 650);              //400, 400
            button_continue.Text     = "Continue";
            button_continue.Font     = new System.Drawing.Font("Comic Sans MS", 26F, FontStyle.Bold);

            //Creates TextBox for leadboard name entry
            textbox_leaderboard = new TextBox();
            //x_textbox = (x - textbox_leaderboard.Width) / 2;
            textbox_leaderboard.Name     = "textbox_leaderboard";
            textbox_leaderboard.Size     = new System.Drawing.Size(350, 150);
            textbox_leaderboard.TabIndex = 0;
            textbox_leaderboard.Font     = new System.Drawing.Font("Microsoft Sans Serif", 20F);
            textbox_leaderboard.Location = new System.Drawing.Point(180, 400);

            // this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);

            //Creates a button to save name for leaderboard
            button_leaderboard_name_save          = new Button();
            button_leaderboard_name_save.AutoSize = true;
            //x_button = (x - button_leaderboard_name_save.Width) / 2;
            button_leaderboard_name_save.Size     = new System.Drawing.Size(100, 50);
            button_leaderboard_name_save.Text     = "Submit";
            button_leaderboard_name_save.Font     = new System.Drawing.Font("Comic Sans MS", 26F, FontStyle.Bold);
            button_leaderboard_name_save.Location = new Point(305, 450);
            button_leaderboard_name_save.Click   += new EventHandler(save_name);


            //Creates a listBox for the top 5 leaderboard
            listBox_leaderboard = new ListBox();
            listBox_leaderboard.FormattingEnabled = true;
            listBox_leaderboard.Location          = new System.Drawing.Point(251, 200);
            listBox_leaderboard.Name     = "listBox_leaderboard";
            listBox_leaderboard.Size     = new System.Drawing.Size(200, 200);
            listBox_leaderboard.TabIndex = 0;
            listBox_leaderboard.Font     = new System.Drawing.Font("Comic Sans MS", 16F, FontStyle.Bold);


            //Add all created controls to panel
            panel_results.Controls.Add(button_return);
            panel_results.Controls.Add(button_continue);
            panel_results.Controls.Add(label_score);
            panel_results.Controls.Add(label_win_lose);
            panel_results.Controls.Add(button_leaderboard_name_save);
            panel_results.Controls.Add(textbox_leaderboard);
            panel_results.Controls.Add(listBox_leaderboard);

            //Add Panel to form
            this.Controls.Add(panel_results);
            label_win_lose.Show();
            label_score.Show();
            this.panel_results.BringToFront();

            //Depending on the player's score, it will say either they won or lost
            int passingScore = 1000;

            if (gamePlay.score >= passingScore)
            {
                label_win_lose.Text = "You Win!";

                //System.Media.SoundPlayer player = new System.Media.SoundPlayer(global::Mustache_ic___V2.Properties.Resources.WINNER);
                //player.Play();
                listBox_leaderboard.Hide();
                button_leaderboard_name_save.Show();
                textbox_leaderboard.Show();
            }
            else
            {
                label_win_lose.Text = "You Lose!";
                button_leaderboard_name_save.Hide();
                textbox_leaderboard.Hide();
                //listBox_leaderboard.Hide();
                //System.Media.SoundPlayer player = new System.Media.SoundPlayer(global::Mustache_ic___V2.Properties.Resources.Price_Is_Right_loser_clip);
                //player.Play();
                get_leaderboard();
            }
        }
コード例 #13
0
        private void newPlayerCombatantUIRow(int i)
        {
            Panel combatantPanel = new System.Windows.Forms.Panel();
            Button combatantInfo = new System.Windows.Forms.Button();
            Button healButton = new System.Windows.Forms.Button();
            Button damageButton = new System.Windows.Forms.Button();
            TextBox damageTextBox = new System.Windows.Forms.TextBox();
            Label combatantHP = new System.Windows.Forms.Label();
            Label combatantAC = new System.Windows.Forms.Label();
            Label combatantName = new System.Windows.Forms.Label();

            this.combatTab.Controls.Add(combatantPanel);
            combatantPanel.SuspendLayout();
            //
            // combatantPanel
            //
            combatantPanel.Controls.Add(combatantInfo);
            combatantPanel.Controls.Add(healButton);
            combatantPanel.Controls.Add(damageButton);
            combatantPanel.Controls.Add(damageTextBox);
            combatantPanel.Controls.Add(combatantHP);
            combatantPanel.Controls.Add(combatantAC);
            combatantPanel.Controls.Add(combatantName);
            combatantPanel.Name = "combatantPanel" + i;
            combatantPanel.Parent = this.combatTab;
            combatantPanel.Size = new System.Drawing.Size(714, 30);
            combatantPanel.Location = new System.Drawing.Point(6, 31 + (i * ROW_HEIGHT));
            combatantPanel.BorderStyle = BorderStyle.FixedSingle;
            combatantPanel.TabIndex = 1;
            combatantPanel.Show();

            if (i % 2 == 1)
            {
                combatantPanel.BackColor = Color.LightBlue;
            }

            //
            // combatantInfo
            //
            combatantInfo.Name = "combatantInfo" + i;
            combatantInfo.Size = new System.Drawing.Size(28, 23);
            combatantInfo.Location = new System.Drawing.Point(683, 2);
            combatantInfo.TabIndex = 6;
            combatantInfo.Text = "...";
            combatantInfo.UseVisualStyleBackColor = true;
            combatantInfo.Parent = combatantPanel;
            combatantInfo.Show();

            //
            // healButton
            //
            healButton.Name = "healButton" + i;
            healButton.Size = new System.Drawing.Size(19, 23);
            healButton.Location = new System.Drawing.Point(600, 2);
            healButton.TabIndex = 5;
            healButton.Text = "+";
            healButton.UseVisualStyleBackColor = true;
            healButton.Parent = combatantPanel;
            healButton.Show();

            //
            // damageButton
            //
            damageButton.Name = "damageButton" + i;
            damageButton.Size = new System.Drawing.Size(19, 23);
            damageButton.Location = new System.Drawing.Point(578, 2);
            damageButton.TabIndex = 4;
            damageButton.Text = "-";
            damageButton.UseVisualStyleBackColor = true;
            damageButton.Parent = combatantPanel;
            damageButton.Show();

            //
            // damageTextBox
            //
            damageTextBox.Name = "damageTextBox" + i;
            damageTextBox.Size = new System.Drawing.Size(45, 22);
            damageTextBox.Location = new System.Drawing.Point(530, 2);
            damageTextBox.TabIndex = 3;
            damageButton.Parent = combatantPanel;
            damageButton.Show();

            //
            // combatantHP
            //
            combatantHP.AutoSize = true;
            combatantHP.Font = new System.Drawing.Font("Calibri", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            combatantHP.Name = "combatantHP" + i;
            combatantHP.Size = new System.Drawing.Size(71, 23);
            combatantHP.Location = new System.Drawing.Point(400, 2);
            combatantHP.TabIndex = 2;
            combatantHP.Text = String.Format("HP: {0}/{1}", GameManagement.playerCharacters[i].currentHitPoints, GameManagement.playerCharacters[i].hitPoints);
            combatantHP.Parent = combatantPanel;
            combatantHP.Show();

            //
            // combatantAC
            //
            combatantAC.AutoSize = true;
            combatantAC.Font = new System.Drawing.Font("Calibri", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            combatantAC.Name = "combatantAC" + i;
            combatantAC.Size = new System.Drawing.Size(60, 23);
            combatantAC.Location = new System.Drawing.Point(300, 2);
            combatantAC.TabIndex = 1;
            combatantAC.Text = "AC: " + GameManagement.playerCharacters[i].armorClass;
            combatantAC.Show();
            //
            // combatantName
            //
            combatantName.AutoSize = true;
            combatantName.Font = new System.Drawing.Font("Calibri", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            combatantName.Name = "combatantName" + i;
            combatantName.Size = new System.Drawing.Size(3, 23);
            combatantName.Location = new System.Drawing.Point(3, 2);
            combatantName.TabIndex = 0;
            combatantName.Text = GameManagement.playerCharacters[i].name;
            combatantName.Show();

            // Resume Layout
            combatantPanel.ResumeLayout(false);
            combatantPanel.PerformLayout();
        }
コード例 #14
0
ファイル: Form1.cs プロジェクト: modulexcite/cDashboard
        /// <summary>1
        /// Setup multiple monitor wizard
        /// </summary>
        /// <param name="isFreshInstall">true if this is a new install, false if just a monitor switch</param>
        private void multiMonitorSetup(bool isFreshInstall)
        {
            //alert the user as to what is going on, only if this is a new install
            if (isFreshInstall == true)
            {
                MessageBox.Show("Hello! cDashBoard has detected that you have " + Screen.AllScreens.Count().ToString() + " Monitors. So this little wizard will allow cDashBoard to be setup and appear properly. After clicking Ok, you will see giant big white boxes over each monitor. Click the box on the monitor you want cDashBoard to appear on. Don't worry this can be changed later.", "cDashboard Multi-Monitor Setup");
            }
            //make the boxes appear
            foreach (Screen s in Screen.AllScreens)
            {
                //create a form that will overlay Screen s
                Form form_tmp = new Form();
                form_tmp.Click += new EventHandler(Monitor_Overlay_Click);
                form_tmp.Opacity = .9;
                form_tmp.Name = "Multi_Monitor_Selection_Overlay";
                form_tmp.WindowState = FormWindowState.Normal;
                form_tmp.StartPosition = FormStartPosition.Manual;
                form_tmp.Location = s.Bounds.Location;
                form_tmp.FormBorderStyle = FormBorderStyle.None;
                form_tmp.SizeGripStyle = SizeGripStyle.Hide;
                form_tmp.WindowState = FormWindowState.Maximized;
                form_tmp.TopMost = true;
                form_tmp.Show();
                //create label for the new form
                Label label_monitor_name = new Label();
                form_tmp.Controls.Add(label_monitor_name);
                label_monitor_name.Show();
                label_monitor_name.AutoSize = true;
                //make the label talk about the monitor
                label_monitor_name.Text = "Click the monitor you would like to use for cDashBoard\n" + s.ToString();
                label_monitor_name.Location = new Point((form_tmp.Width / 2) - label_monitor_name.Width / 2, (form_tmp.Height / 2) - label_monitor_name.Height / 2);

                //add span button
                Button button_span = new Button();
                form_tmp.Controls.Add(button_span);
                button_span.Show();
                button_span.AutoSize = true;
                button_span.FlatStyle = FlatStyle.Flat;
                button_span.Text = "Span All Monitors";
                button_span.Location = new Point(5, 5);
                button_span.Click += new EventHandler(Multi_Monitor_button_span_Click);

                if (isFreshInstall == false)
                {
                    //add a cancel button to each form
                    Button button_cancel = new Button();
                    form_tmp.Controls.Add(button_cancel);
                    button_cancel.Show();
                    button_cancel.AutoSize = true;
                    button_cancel.FlatStyle = FlatStyle.Flat;
                    button_cancel.Text = "Cancel";
                    button_cancel.Location = new Point(button_span.Location.X + button_span.Size.Width + 5, 5);
                    button_cancel.Click += new EventHandler(Mult_Monitor_button_cancel_Click);
                }
            }
        }
コード例 #15
0
ファイル: NewWord.cs プロジェクト: AndreySaveliy/ASKL
        public DialogResult AddWord()
        {
            Form wordForm = new Form();
            wordForm.StartPosition = FormStartPosition.CenterScreen;
            wordForm.FormBorderStyle = FormBorderStyle.Fixed3D;
            wordForm.Size = new Size(250, 180);
            wordForm.MinimizeBox = false;
            wordForm.MaximizeBox = false;
            wordForm.Text = "Новое слово";

            Label wordLabel = new Label();
            wordLabel.Location = new Point(10, 10);
            wordLabel.AutoSize = false;
            wordLabel.Size = new Size(230, 25);
            wordLabel.Font = new Font("Times New Roman", 12, FontStyle.Bold);
            wordLabel.Text = "Слово: ";

            Label translateLabel = new Label();
            translateLabel.Location = new Point(10, 60);
            translateLabel.AutoSize = false;
            translateLabel.Size = new Size(230, 25);
            translateLabel.Font = new Font("Times New Roman", 12, FontStyle.Bold);
            translateLabel.Text = "Перевод: ";

            wordTextBox = new TextBox();
            wordTextBox.Location = new Point(10, 35);
            wordTextBox.Size = new Size(215, 25);
            wordTextBox.Text = null;

            translateTextBox = new TextBox();
            translateTextBox.Location = new Point(10, 85);
            translateTextBox.Size = new Size(215, 25);
            translateTextBox.Text = null;

            Button okButton = new Button();
            okButton.Location = new Point(80, 115);
            okButton.Size = new Size(70, 25);
            okButton.DialogResult = DialogResult.OK;
            okButton.Text = "OK";

            Button cancelButton = new Button();
            cancelButton.Location = new Point(155, 115);
            cancelButton.Size = new Size(70, 25);
            cancelButton.DialogResult = DialogResult.Cancel;
            cancelButton.Text = "Cancel";

            wordForm.Controls.Add(wordLabel);
            wordForm.Controls.Add(translateLabel);
            wordForm.Controls.Add(wordTextBox);
            wordForm.Controls.Add(translateTextBox);
            wordForm.Controls.Add(okButton);
            wordForm.Controls.Add(cancelButton);
            wordLabel.Show();
            translateLabel.Show();
            wordTextBox.Show();
            translateTextBox.Show();
            okButton.Show();
            cancelButton.Show();
            wordForm.ShowDialog();

            return wordForm.DialogResult;
        }
コード例 #16
0
        // Yeah, yeah, so I should probably make this accept params. We'll see if it happens later on. 
        private void populateUsers()
        {
            // Also shoutout to automatic definition handling 
            // Ah, C#, it's great to be here again.

            // Go through each user
            // (could have also used the count from anything else that holds a user property)
            for (int i = 0; i < Properties.Settings.Default.username.Count; i++)
            {

                int t = 0;
                
                Panel uA = new Panel();
                uA.Show();
                uA.BackColor = Color.White;
                //uA.BackColor = Color.FromName(Properties.Settings.Default.custColor[i]);
                uA.Left = 0;
                uA.Width = this.Width;
                uA.Height = 50;
                uA.Margin = new Padding(0, 2, 0, 0);
                
                userList.Controls.Add(uA);

                PictureBox pImg = new PictureBox();
                pImg.Image = Image.FromFile(Properties.Settings.Default.userimgacc_path[i]);
                pImg.Left = 0;
                pImg.Width = 50;
                pImg.Height = 50;
                pImg.Dock = DockStyle.Left;
                pImg.BackColor = Color.White;
                pImg.SizeMode = PictureBoxSizeMode.Zoom;
                
                Label turnip = new Label();
                turnip.Show();
                turnip.BackColor = Color.Transparent;
                turnip.AutoEllipsis = true;
                turnip.Left = 64;
                turnip.Width = this.Width - 64 - 50;
                turnip.Height = 50;
                turnip.Top = 0;
                turnip.Font = new System.Drawing.Font(Properties.Settings.Default.fontsOfScience[Properties.Settings.Default.whoIsThisCrazyDoge], 11);
                turnip.ForeColor = Color.DimGray;
                //turnip.ForeColor = Color.White;
                turnip.TextAlign = ContentAlignment.MiddleLeft;
                turnip.Text = Properties.Settings.Default.username[i];

                uA.Controls.Add(pImg);
                uA.Controls.Add(turnip);

                Button dl = new Button();
                dl.Show();
                dl.BackColor = Color.Firebrick;
                
                dl.Width = 50;
                dl.Left = uA.Width - 50;
                dl.Height = 50;
                dl.Dock = DockStyle.Right;

                dl.Font = new System.Drawing.Font(Properties.Settings.Default.fontsOfScience[Properties.Settings.Default.whoIsThisCrazyDoge], 11);
                dl.ForeColor = Color.White;
                dl.TextAlign = ContentAlignment.MiddleCenter;
                dl.Text = "X";

                dl.FlatStyle = FlatStyle.Flat;
                dl.FlatAppearance.BorderSize = 0;
                
                uA.Controls.Add(dl);

                // Shhhhhhhhhhh hidden controls

                Label toDel = new Label();

                toDel.Show();
                toDel.BackColor = Color.Transparent;
                toDel.AutoEllipsis = true;
                toDel.Left = 64;
                toDel.Width = this.Width - 64 - 50;
                toDel.Height = 18;
                toDel.Top = 50;
                toDel.Font = new System.Drawing.Font(Properties.Settings.Default.fontsOfScience[Properties.Settings.Default.whoIsThisCrazyDoge], 11);
                toDel.ForeColor = Color.Red;
                toDel.TextAlign = ContentAlignment.MiddleLeft;
                toDel.Text = "To delete this account, enter the password:"******"PSR002: User data incorrectly populated for matching with user element.");
                            ts.Show();
                            ts.BringToFront();
                        }
                        else if (pBox.Text == Properties.Settings.Default.woahThereHello[t])
                        {
                            
                            Properties.Settings.Default.custColor.RemoveAt(t);
                            Properties.Settings.Default.lock_path.RemoveAt(t);
                            Properties.Settings.Default.loggedIn.RemoveAt(t);
                            Properties.Settings.Default.nickname.RemoveAt(t);
                            Properties.Settings.Default.space_back_path.RemoveAt(t);
                            Properties.Settings.Default.userimgacc_path.RemoveAt(t);
                            Properties.Settings.Default.username.RemoveAt(t);
                            Properties.Settings.Default.woahThereHello.RemoveAt(t);
                            Properties.Settings.Default.fontsOfScience.RemoveAt(t);
                            Properties.Settings.Default.darkerFontsOfScience.RemoveAt(t);
                            Properties.Settings.Default.Save();

                            try
                            {
                                System.IO.Directory.Delete(@"C:\ProjectSnowshoes\User\" + turnip.Text, true); // Note that we have to use this as a source for username, since we removed it from Settings earlier.
                            }
                            catch (Exception ex)
                            {
                                // This is a terrible way to do error reporting...knowing that errors might occur here if there's a problem with accounts not having actual files
                                // Hey, all that's not going to be a problem in Escape though, since we are getting away from VC# settings...and VC# for the most part as well.
                                TheScreenIsBlue ts = new TheScreenIsBlue("PSR003: User information removed, but files damaged or missing for requested username (" + ex.HResult + ").");
                                ts.Show();
                                ts.BringToFront();
                            }

                            goBackJack();
                        }
                        else
                        {
                            pBox.Text = "";
                            toDel.Text = "That won't work. Try something else.";
                        }
                    }
                };

            }
        }
コード例 #17
0
        private void BeginEditing()
        {
            EndEditing(true);
            _editing = true;
            if (_editingIndex != -1)
            {
                _txtInclude = new TextBox();
                _txtInclude.Leave += txtInclude_Leave;
                _txtInclude.Text = includeList.Items[includeList.SelectedIndex].ToString();
                _editingIncludeDir = _txtInclude.Text;
                includeList.SelectionMode = SelectionMode.One;

                Rectangle rect = includeList.GetItemRectangle(includeList.SelectedIndex);
                _txtInclude.Location = new Point(includeList.Location.X + 2,
                                                 includeList.Location.Y + rect.Y);
                _txtInclude.Width = includeList.Width - 50;
                _txtInclude.Parent = includeList;
                _txtInclude.KeyUp += new KeyEventHandler(txtInclude_KeyUp);
                groupBox1.Controls.Add(_txtInclude);

                _btnSelectInclude = new Button();
                _btnSelectInclude.Text = "...";
                _btnSelectInclude.Location = new Point(includeList.Location.X + _txtInclude.Width,
                                                       includeList.Location.Y + rect.Y);
                _btnSelectInclude.Width = 50;
                _btnSelectInclude.Height = _txtInclude.Height;
                _btnSelectInclude.Click += new EventHandler(btnSelectInclude_Clicked);
                groupBox1.Controls.Add(_btnSelectInclude);


                _txtInclude.Show();
                _txtInclude.BringToFront();
                _txtInclude.Focus();

                _btnSelectInclude.Show();
                _btnSelectInclude.BringToFront();
            }
        }
コード例 #18
0
        public bool AddPlayerCharacterToPanel()
        {
            if(GameManagement.playerCharacters.Count != 0)
            {
                int playerIndex = GameManagement.playerCharacters.Count-1;
                PlayerCharacter player = GameManagement.playerCharacters[playerIndex];

                if (this.PlayerCharacterPanel.Controls.Find("pcPanel" + player.name, true).Count() > 0)
                {
                    return false;
                }

                Panel pcPanel1 = new Panel();
                pcPanel1.Parent = this.PlayerCharacterPanel;

                Label CharNameDisp = new Label();
                Label RaceClassDisp = new Label();
                Button MoreInfoButton = new Button();
                Label ArmorClassDisp = new Label();
                Label LevelDisp = new Label();
                Label HPDisp = new Label();
                Button DamageBtn = new Button();
                Button HealButton = new Button();
                TextBox HPModTextBox = new TextBox();

                //
                // pcPanel1
                //
                pcPanel1.Controls.Add(DamageBtn);
                pcPanel1.Controls.Add(HealButton);
                pcPanel1.Controls.Add(HPModTextBox);
                pcPanel1.Controls.Add(MoreInfoButton);
                pcPanel1.Controls.Add(ArmorClassDisp);
                pcPanel1.Controls.Add(LevelDisp);
                pcPanel1.Controls.Add(HPDisp);
                pcPanel1.Controls.Add(RaceClassDisp);
                pcPanel1.Controls.Add(CharNameDisp);
                pcPanel1.Location = new System.Drawing.Point(3, 3);
                pcPanel1.Name = "pcPanel" + player.name;
                pcPanel1.Size = new System.Drawing.Size(219, 82);
                pcPanel1.TabIndex = 0;

                //
                // CharNameDisp
                //
                CharNameDisp.AutoSize = true;
                CharNameDisp.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
                CharNameDisp.Location = new System.Drawing.Point(2, 5);
                CharNameDisp.Name = "CharNameDisp" + playerIndex;
                CharNameDisp.Size = new System.Drawing.Size(91, 20);
                CharNameDisp.TabIndex = 0;
                CharNameDisp.Text = player.name;
                CharNameDisp.Parent = pcPanel1;
                CharNameDisp.Show();

                //
                // RaceClassDisp
                //
                RaceClassDisp.AutoSize = true;
                RaceClassDisp.Location = new System.Drawing.Point(5, 39);
                RaceClassDisp.Name = "RaceClassDisp" + playerIndex;
                RaceClassDisp.Size = new System.Drawing.Size(70, 13);
                RaceClassDisp.TabIndex = 1;

                if(player.subClass == null)
                {
                    RaceClassDisp.Text = String.Format("{0}, {1}", player.race, player.primaryClass);
                }
                else
                {
                    RaceClassDisp.Text = String.Format("{0}, {1}/{2}", player.race, player.primaryClass, player.subClass);
                }

                RaceClassDisp.Parent = pcPanel1;
                RaceClassDisp.Show();

                //
                // HPDisp
                //
                HPDisp.AutoSize = false;
                HPDisp.Location = new System.Drawing.Point(139, 39);
                HPDisp.Name = "HPDisp" + playerIndex;
                HPDisp.Size = new System.Drawing.Size(77, 13);
                HPDisp.TabIndex = 2;
                HPDisp.Text = String.Format("HP: {0}/{1}", player.currentHitPoints, player.hitPoints);
                HPDisp.TextAlign = ContentAlignment.MiddleRight;
                HPDisp.Parent = pcPanel1;
                HPDisp.Show();

                //
                // LevelDisp
                //
                LevelDisp.AutoSize = true;
                LevelDisp.Location = new System.Drawing.Point(5, 26);
                LevelDisp.Name = "LevelDisp" + playerIndex;
                LevelDisp.Size = new System.Drawing.Size(45, 13);
                LevelDisp.TabIndex = 3;
                LevelDisp.Text = String.Format("Level: {0}", player.primaryClassLevel);
                LevelDisp.Parent = pcPanel1;
                LevelDisp.Show();

                //
                // ArmorClassDisp
                //
                ArmorClassDisp.AutoSize = false;
                ArmorClassDisp.Location = new System.Drawing.Point(139, 26);
                ArmorClassDisp.Name = "ArmorClassDisp" + playerIndex;
                ArmorClassDisp.Size = new System.Drawing.Size(77, 13);
                ArmorClassDisp.TabIndex = 4;
                ArmorClassDisp.Text = String.Format("AC: {0}", player.armorClass);
                ArmorClassDisp.TextAlign = ContentAlignment.MiddleRight;
                ArmorClassDisp.Parent = pcPanel1;
                ArmorClassDisp.Show();

                //
                // MoreInfoButton
                //
                MoreInfoButton.Location = new System.Drawing.Point(8, 55);
                MoreInfoButton.Name = "MoreInfoButton" + playerIndex;
                MoreInfoButton.Size = new System.Drawing.Size(35, 24);
                MoreInfoButton.TabIndex = 5;
                MoreInfoButton.Text = "...";
                MoreInfoButton.UseVisualStyleBackColor = true;
                MoreInfoButton.Parent = pcPanel1;
                MoreInfoButton.Show();

                //
                // HealButton
                //
                HealButton.Location = new System.Drawing.Point(131, 55);
                HealButton.Name = "HealButton" + playerIndex;
                HealButton.Size = new System.Drawing.Size(20, 24);
                HealButton.TabIndex = 7;
                HealButton.Text = "+";
                HealButton.UseVisualStyleBackColor = true;
                HealButton.Parent = pcPanel1;
                HealButton.Click += new System.EventHandler(this.HealPlayerButton_Click);
                HealButton.Show();

                //
                // DamageBtn
                //
                DamageBtn.Location = new System.Drawing.Point(196, 55);
                DamageBtn.Name = "DamageBtn" + playerIndex;
                DamageBtn.Size = new System.Drawing.Size(20, 24);
                DamageBtn.TabIndex = 8;
                DamageBtn.Text = "-";
                DamageBtn.UseVisualStyleBackColor = true;
                DamageBtn.Parent = pcPanel1;
                DamageBtn.Click += new System.EventHandler(this.DamagePlayerButton_Click);
                DamageBtn.Show();

                //
                // HPModTextBox
                //
                HPModTextBox.Location = new System.Drawing.Point(152, 55);
                HPModTextBox.Name = "HPModTextBox" + playerIndex;
                HPModTextBox.Size = new System.Drawing.Size(43, 25);
                HPModTextBox.TabIndex = 6;
                HPModTextBox.Parent = pcPanel1;
                HPModTextBox.Show();

                //Cleanup
                CharNameDisp = null;
                RaceClassDisp = null;
                MoreInfoButton = null;
                ArmorClassDisp = null;
                LevelDisp = null;
                HPDisp = null;
                DamageBtn = null;
                HealButton = null;
                HPModTextBox = null;
            }

            return true;
        }
コード例 #19
0
		private void OnCellMouseDown(MyDataGridView dataGridViewCharacters, ref Button btnZoom, Font font, TableLayoutPanel ZoomButtonParent,
			SendToEditorForms eOutputForm, bool bIsLegacy, DataGridViewCellMouseEventArgs e)
		{
			if ((e.RowIndex >= 0) && (e.ColumnIndex >= 0))
			{
				m_mbButtonDown = e.Button;

				DataGridViewCell aCell = dataGridViewCharacters.Rows[e.RowIndex].Cells[e.ColumnIndex];
				if (m_mbButtonDown == MouseButtons.Right)
				{
					// simply selecting the cell will trigger the zoom button update
					//  (but only if it's already activated)
					if (btnZoom == null)
						ShowZoomButton(ref btnZoom, font, ZoomButtonParent, eOutputForm, bIsLegacy, aCell);
					else if (!btnZoom.Visible)
						btnZoom.Show();

					// either way, select the cell
					aCell.Selected = true;
				}
			}
		}
コード例 #20
0
        private void AddExistingNoteTab(DateTime date, String noteTitle, String noteContent, String providerName, String noteheader)
        {
            TabPage newTab = new TabPage();


            Button      newSignButton          = new System.Windows.Forms.Button();
            Label       newDateValueLabel      = new System.Windows.Forms.Label();
            RichTextBox newAddendumBox         = new System.Windows.Forms.RichTextBox();
            Label       newTitleValueNameLabel = new System.Windows.Forms.Label();
            Button      newAddendumButton      = new System.Windows.Forms.Button();
            Label       newNoteLabel           = new System.Windows.Forms.Label();
            RichTextBox newNoteBox             = new System.Windows.Forms.RichTextBox();
            Label       newDateLabel           = new System.Windows.Forms.Label();
            Label       newNoteTitleLabel      = new System.Windows.Forms.Label();
            Label       newAddendumLabel       = new System.Windows.Forms.Label();
            Button      newExitButton          = new System.Windows.Forms.Button();

            // SignButton1
            //
            newSignButton.BackColor    = System.Drawing.SystemColors.ActiveCaption;
            newSignButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            newSignButton.FlatAppearance.BorderSize = 0;
            newSignButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            newSignButton.Font      = new System.Drawing.Font("Bahnschrift Light", 10F);
            newSignButton.Location  = new System.Drawing.Point(437, 49);
            newSignButton.Name      = "newSignButton";
            newSignButton.Size      = new System.Drawing.Size(94, 26);
            newSignButton.TabIndex  = 66;
            newSignButton.Text      = "Sign";
            newSignButton.UseVisualStyleBackColor = false;
            newSignButton.Hide();
            newSignButton.Click += new System.EventHandler(ExistingSignButtonClick);

            //
            // DateValueLabel1
            //
            newDateValueLabel.AutoSize  = true;
            newDateValueLabel.Font      = new System.Drawing.Font("Bahnschrift Light", 10F);
            newDateValueLabel.Location  = new System.Drawing.Point(101, 12);
            newDateValueLabel.Name      = "newDateValueLabel";
            newDateValueLabel.Size      = new System.Drawing.Size(82, 17);
            newDateValueLabel.TabIndex  = 57;
            newDateValueLabel.Text      = date.ToShortDateString();
            newDateValueLabel.TextAlign = System.Drawing.ContentAlignment.BottomRight;
            //
            // AddendumBox1
            //
            newAddendumBox.Font         = new System.Drawing.Font("Bahnschrift Light", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            newAddendumBox.Location     = new System.Drawing.Point(7, 314);
            newAddendumBox.Multiline    = true;
            newAddendumBox.Name         = "newAddendumBox";
            newAddendumBox.Size         = new System.Drawing.Size(650, 254);
            newAddendumBox.TabIndex     = 56;
            newAddendumBox.TextChanged += new System.EventHandler(this.AddendumBox_TextChanged);
            newAddendumBox.ScrollBars   = RichTextBoxScrollBars.Vertical;
            newAddendumBox.BorderStyle  = BorderStyle.FixedSingle;

            newAddendumBox.Hide();
            //
            // TitleNameLabel
            //
            newTitleValueNameLabel.AutoSize  = true;
            newTitleValueNameLabel.Font      = new System.Drawing.Font("Bahnschrift Light", 10F);
            newTitleValueNameLabel.Location  = new System.Drawing.Point(101, 38);
            newTitleValueNameLabel.Name      = "newTitleValueNameLabel";
            newTitleValueNameLabel.Size      = new System.Drawing.Size(36, 17);
            newTitleValueNameLabel.TabIndex  = 53;
            newTitleValueNameLabel.Text      = noteTitle;
            newTitleValueNameLabel.TextAlign = System.Drawing.ContentAlignment.BottomRight;
            //
            // AddendumButton
            //
            newAddendumButton.BackColor    = System.Drawing.SystemColors.ActiveCaption;
            newAddendumButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            newAddendumButton.FlatAppearance.BorderSize = 0;
            newAddendumButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            newAddendumButton.Font      = new System.Drawing.Font("Bahnschrift Light", 10F);
            newAddendumButton.Location  = new System.Drawing.Point(437, 49);
            newAddendumButton.Name      = "newAddendumButton";
            newAddendumButton.Size      = new System.Drawing.Size(94, 26);
            newAddendumButton.TabIndex  = 52;
            newAddendumButton.Text      = "Addendum";
            newAddendumButton.UseVisualStyleBackColor = false;
            newAddendumButton.Click += new System.EventHandler(AddendumButtonClick);
            newAddendumButton.Show();
            //
            // NoteLabel1
            //
            newNoteLabel.AutoSize  = true;
            newNoteLabel.Font      = new System.Drawing.Font("Bahnschrift Light", 10F);
            newNoteLabel.Location  = new System.Drawing.Point(26, 64);
            newNoteLabel.Name      = "newNoteLabel";
            newNoteLabel.Size      = new System.Drawing.Size(42, 17);
            newNoteLabel.TabIndex  = 51;
            newNoteLabel.Text      = "Note:";
            newNoteLabel.TextAlign = System.Drawing.ContentAlignment.BottomRight;
            //
            // NoteBox1
            //
            newNoteBox.Font      = new System.Drawing.Font("Bahnschrift Light", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            newNoteBox.Location  = new System.Drawing.Point(6, 100);
            newNoteBox.Multiline = true;
            newNoteBox.Name      = "newNoteBox";
            if (noteContent.Contains("wrote on: "))
            {
                newNoteBox.Text = noteContent;
            }
            else
            {
                newNoteBox.Text = noteheader + "\n" + noteContent.Replace(noteheader, "") + "\n";
            }
            newNoteBox.Size        = new System.Drawing.Size(738, 623);
            newNoteBox.TabIndex    = 50;
            newNoteBox.ScrollBars  = RichTextBoxScrollBars.Vertical;
            newNoteBox.BorderStyle = BorderStyle.FixedSingle;

            //

            //
            // DateLabel1
            //
            newDateLabel.AutoSize  = true;
            newDateLabel.Font      = new System.Drawing.Font("Bahnschrift Light", 10F);
            newDateLabel.Location  = new System.Drawing.Point(26, 12);
            newDateLabel.Name      = "newDateLabel";
            newDateLabel.Size      = new System.Drawing.Size(40, 17);
            newDateLabel.TabIndex  = 47;
            newDateLabel.Text      = "Date: ";
            newDateLabel.TextAlign = System.Drawing.ContentAlignment.BottomRight;
            //
            // NoteTitleLabel1
            //
            newNoteTitleLabel.AutoSize  = true;
            newNoteTitleLabel.Font      = new System.Drawing.Font("Bahnschrift Light", 10F);
            newNoteTitleLabel.Location  = new System.Drawing.Point(26, 38);
            newNoteTitleLabel.Name      = "newNoteTitleLabel";
            newNoteTitleLabel.Size      = new System.Drawing.Size(72, 17);
            newNoteTitleLabel.TabIndex  = 46;
            newNoteTitleLabel.Text      = "Note Title: ";
            newNoteTitleLabel.TextAlign = System.Drawing.ContentAlignment.BottomRight;


            // newAddendumLabel
            //
            newAddendumLabel.AutoSize  = true;
            newAddendumLabel.Font      = new System.Drawing.Font("Bahnschrift Light", 10F);
            newAddendumLabel.Location  = new System.Drawing.Point(24, 293);
            newAddendumLabel.Name      = "newAddendumLabel";
            newAddendumLabel.Size      = new System.Drawing.Size(77, 17);
            newAddendumLabel.TabIndex  = 67;
            newAddendumLabel.Text      = "Addendum: ";
            newAddendumLabel.TextAlign = System.Drawing.ContentAlignment.BottomRight;
            newAddendumLabel.Hide();

            //newExitButton

            newExitButton.BackColor    = System.Drawing.SystemColors.ActiveCaption;
            newExitButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            newExitButton.FlatAppearance.BorderSize = 0;
            newExitButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            newExitButton.Font      = new System.Drawing.Font("Bahnschrift Light", 10F);
            newExitButton.Location  = new System.Drawing.Point(550, 49);
            newExitButton.Name      = "ExitButton";
            newExitButton.Size      = new System.Drawing.Size(94, 26);
            newExitButton.TabIndex  = 52;
            newExitButton.Text      = "Exit";
            newExitButton.UseVisualStyleBackColor = false;
            newExitButton.Click += new System.EventHandler(ExitButtonClick);



            newTab.Controls.Add(newExitButton);
            newTab.Controls.Add(newSignButton);
            newTab.Controls.Add(newDateValueLabel);
            newTab.Controls.Add(newAddendumBox);
            newTab.Controls.Add(newTitleValueNameLabel);
            newTab.Controls.Add(newAddendumButton);
            newTab.Controls.Add(newNoteLabel);
            newTab.Controls.Add(newNoteBox);
            newTab.Controls.Add(newDateLabel);
            newTab.Controls.Add(newNoteTitleLabel);
            newTab.Controls.Add(newAddendumLabel);
            newTab.Location = new System.Drawing.Point(4, 22);
            newTab.Padding  = new System.Windows.Forms.Padding(3);
            newTab.Size     = new System.Drawing.Size(669, 584);
            newTab.TabIndex = NewNoteTabControl.TabCount;
            newTab.Text     = noteTitle;
            newTab.UseVisualStyleBackColor = true;

            NewNoteTabControl.TabPages.Add(newTab);
            NewNoteTabControl.SelectedTab = newTab;
        }
コード例 #21
0
ファイル: IncludePathView.cs プロジェクト: bholl/zeroc-ice
        private void beginEditIncludeDir()
        {
            if(_editingIncludes)
            {
                endEditIncludeDir(true);
            }
            _editingIncludes = true;
            _dialog.unsetCancelButton();
            if(_editingIndex != -1)
            {
                _txtIncludeDir = new TextBox();
                _txtIncludeDir.Text = sliceIncludeList.Items[sliceIncludeList.SelectedIndex].ToString();
                _editingIncludeDir = _txtIncludeDir.Text;
                sliceIncludeList.SelectionMode = SelectionMode.One;

                Rectangle rect = sliceIncludeList.GetItemRectangle(sliceIncludeList.SelectedIndex);
                _txtIncludeDir.Location = new Point(sliceIncludeList.Location.X + 2,
                                                    sliceIncludeList.Location.Y + rect.Y);
                _txtIncludeDir.Width = sliceIncludeList.Width - 50;
                _txtIncludeDir.Parent = sliceIncludeList;
                _txtIncludeDir.KeyDown += new KeyEventHandler(includeDirKeyDown);
                _txtIncludeDir.KeyUp += new KeyEventHandler(includeDirKeyUp);
                groupBox1.Controls.Add(_txtIncludeDir);

                _btnSelectInclude = new Button();
                _btnSelectInclude.Text = "...";
                _btnSelectInclude.Location = new Point(sliceIncludeList.Location.X + _txtIncludeDir.Width,
                                                       sliceIncludeList.Location.Y + rect.Y);
                _btnSelectInclude.Width = 49;
                _btnSelectInclude.Height = _txtIncludeDir.Height;
                _btnSelectInclude.Click += new EventHandler(selectIncludeClicked);
                groupBox1.Controls.Add(_btnSelectInclude);

                _txtIncludeDir.Show();
                _txtIncludeDir.BringToFront();
                _txtIncludeDir.Focus();

                _btnSelectInclude.Show();
                _btnSelectInclude.BringToFront();
            }
        }
コード例 #22
0
        public void ShowInfoPage()
        {
            this.SuspendLayout();
            WebBrowser webStart = new WebBrowser();
            PNLlist.Controls.Add(webStart);
            webStart.Visible = false;
            webStart.ScriptErrorsSuppressed = true;
            webStart.ScrollBarsEnabled = false;
            webStart.Dock = DockStyle.Fill;
            webStart.BringToFront();

            Button btnClose = new Button();
            this.Controls.Add(btnClose);
            btnClose.Visible = false;
            btnClose.Size = new Size(PNLlist.Width - 6, 35);
            btnClose.Location = new Point(15, PNLlist.Height - 39 + 39);
            btnClose.FlatAppearance.BorderColor = Color.Gray;
            btnClose.BackColor = Color.FromArgb(64, 64, 64);
            btnClose.ForeColor = Color.WhiteSmoke;
            btnClose.Text = "Close";
            btnClose.FlatStyle = FlatStyle.Flat;
            btnClose.BringToFront();
            this.ResumeLayout();

            btnClose.Click += (e, s) =>
            {
                PNLlist.Controls.Remove(webStart);
                this.Controls.Remove(btnClose);
            };
            webStart.Navigated += (e, s) =>
            {
                if (!webStart.Document.ToString().ToLower().Contains("checking your"))
                {
                    webStart.Show();
                    btnClose.Show();
                }
            };
            webStart.Navigate("http://www.realmbot.xyz/hello.html");
        }
コード例 #23
0
        public void LoadSearchConfig(String EditConfigFile)
        {
            this.ConfigFile = EditConfigFile;

            if (!File.Exists(this.ConfigFile))
                return;

            using (StreamReader sr = new StreamReader(this.ConfigFile))
            {
                String line;
                int cLine = 0;
                // Read and display lines from the file until the end of
                // the file is reached.
                while ((line = sr.ReadLine()) != null)
                {
                    cLine++;

                    if ((cLine == 1) && (line != "editor.config.begin"))
                        return; /* invalid or corrupt config file */

                    string[] cfgLine = line.Split('^');

                    if (cfgLine[0] == "set.editor.title")
                    {
                        this.EditorTitle = cfgLine[1];
                    }

                    //configure.editor.window^636^458
                    if (cfgLine[0] == "configure.editor.window")
                    {
                        this.EditorWidth = int.Parse(cfgLine[1]);
                        this.EditorHeight = int.Parse(cfgLine[2]);
                    }

                    if (cfgLine[0] == "add.tab")
                    {
                        // add.tab^TabTitle^canselect yes or no
                        //cfgLine[1];
                        TabPage tPage = new TabPage(cfgLine[1]);
                        this.EditorTabs.Add(cfgLine[1], tPage);
                    }

                    if (cfgLine[0] == "add.button")
                    {
                        //# add.button^id^tabpage^width^height^top^left^value^function
                        //# function can be -   savetodb ,  or closeeditor

                        //add.button^close^General^25^20^100^100^Close^closeeditor
                        TabPage tPage = (TabPage)this.EditorTabs[cfgLine[2]];

                        if (tPage == null)
                            return;

                        Button cmdButton = new Button();

                        cmdButton.Width = int.Parse(cfgLine[3]);
                        cmdButton.Height = int.Parse(cfgLine[4]);

                        cmdButton.Name = cfgLine[1];

                        tPage.Controls.Add(cmdButton);

                        cmdButton.Top = int.Parse(cfgLine[5]);
                        cmdButton.Left = int.Parse(cfgLine[6]);

                        cmdButton.Text = cfgLine[7];

                        cmdButton.Tag = cfgLine[8];

                        cmdButton.Show();

                        cmdButton.Click += new EventHandler(cmdButton_Click);

                    }
                    if (cfgLine[0] == "add.label")
                    {
                        // add.label^id^tabpage^width^height^top^left^value
                        TabPage tPage = (TabPage)this.EditorTabs[cfgLine[2]];

                        if (tPage == null)
                            return;

                        Label lblNew = new Label();

                        lblNew.Width = int.Parse(cfgLine[3]);
                        lblNew.Height = int.Parse(cfgLine[4]);

                        lblNew.Name = cfgLine[1];

                        tPage.Controls.Add(lblNew);

                        lblNew.Top = int.Parse(cfgLine[5]);
                        lblNew.Left = int.Parse(cfgLine[6]);

                        lblNew.Text = cfgLine[7];

                        lblNew.Show();

                    }
                    if (cfgLine[0] == "add.input.control")
                    {
                        // add.input.control^type^id^tabpage^width^height^top^left^dbfield^default value

                        TabPage tPage = (TabPage)this.EditorTabs[cfgLine[3]];

                        if (tPage == null)
                            return;

                        if (cfgLine[1] == "text")
                        {
                            TextBox tBox = new TextBox();

                            tBox.Width = int.Parse(cfgLine[4]);
                            tBox.Height = int.Parse(cfgLine[5]);

                            tBox.Tag = cfgLine[8];
                            tBox.Name = cfgLine[2];

                            tPage.Controls.Add(tBox);

                            tBox.Top = int.Parse(cfgLine[6]);
                            tBox.Left = int.Parse(cfgLine[7]);

                            tBox.Text = cfgLine[9];

                            tBox.Show();

                        }
                        else if (cfgLine[1] == "dropdown")
                        {

                        }
                        else if (cfgLine[1] == "checkbox")
                        {

                        }

                    }

                }
            }
        }
コード例 #24
0
        private void goGenerateTilesFriendship()
        {

            String pathPlease = @"C:\ProjectSnowshoes\User\" + Properties.Settings.Default.username[Properties.Settings.Default.whoIsThisCrazyDoge] + @"\Documents";
            //String pathPlease = @"C:\Users\Robert\Documents";

            for (int i = 0; i < Directory.GetFiles(pathPlease, "*.*", SearchOption.TopDirectoryOnly).Length; i++)
            {
                
                Button doc1 = new Button();
                doc1.Show();
                doc1.BackColor = Color.Transparent;
                doc1.Left = 0;
                doc1.Width = this.Width - 17;
                doc1.Height = openDocsWinExp.Height;
                doc1.Margin = new Padding(0);
                doc1.FlatStyle = FlatStyle.Flat;
                doc1.FlatAppearance.BorderSize = 0;
                doc1.TextAlign = ContentAlignment.MiddleLeft;
                doc1.ImageAlign = ContentAlignment.MiddleLeft;
                
                themDocsTho.Controls.Add(doc1);

                FileInfo fiInf = new FileInfo(Directory.GetFiles(pathPlease, "*.*", SearchOption.TopDirectoryOnly)[i]);
                String fiInfStr = fiInf.Name;
                fiInfStr = fiInfStr.Split('.')[0];

                Label turnip = new Label();
                turnip.Show();
                turnip.BackColor = Color.Transparent;
                turnip.AutoEllipsis = true;
                turnip.Left = 64;
                turnip.Width = doc1.Width - 64;
                turnip.Height = doc1.Height;
                turnip.Top = 0;
                turnip.Font = new System.Drawing.Font(Properties.Settings.Default.fontsOfScience[Properties.Settings.Default.whoIsThisCrazyDoge], 11);
                turnip.ForeColor = Color.DimGray;
                turnip.TextAlign = ContentAlignment.MiddleLeft;
                turnip.Text = fiInfStr;

                IconManager areYouForRealRightNowLikeReallyRealVSWow = new IconManager();
                doc1.Image = areYouForRealRightNowLikeReallyRealVSWow.icoExtReturner(fiInf.FullName, fiInfStr, false);

                DoubleBufferManipulation.SetDoubleBuffered(turnip);
                doc1.Controls.Add(turnip);
                
                doc1.Click += (sender, args) =>
                {
                    System.Diagnostics.Process.Start(fiInf.FullName);
                };

                turnip.Click += (sender, args) =>
                {
                    System.Diagnostics.Process.Start(fiInf.FullName);
                };

            }



        }
コード例 #25
0
ファイル: MainWindow.cs プロジェクト: rgcjonas/tmp
        public MainWindow()
        {
            this.Size = new System.Drawing.Size(500, 380);
            this.Text = "Untitled Application";
            Application.EnableVisualStyles();

            selectFolderBtn = new Button();
            selectFolderBtn.Text = "Add folder with images...";
            selectFolderBtn.Click += HandleSelectFolderBtnClick;
            selectFolderBtn.Location = new System.Drawing.Point(5, 210);
            selectFolderBtn.Size = new System.Drawing.Size(200, 30);
            selectFolderBtn.Show();
            this.Controls.Add(selectFolderBtn);

            selectImageBtn = new Button();
            selectImageBtn.Text = "Add single images...";
            selectImageBtn.Click += HandleSelectImageBtnClick;
            selectImageBtn.Location = new System.Drawing.Point(5, 245);
            selectImageBtn.Size = new System.Drawing.Size(200, 30);
            selectImageBtn.Show();
            this.Controls.Add(selectImageBtn);

            deleteSelectedBtn = new Button();
            deleteSelectedBtn.Text = "Remove selected image from list";
            deleteSelectedBtn.Click += HandleDeleteSelectedBtnClick;
            deleteSelectedBtn.Location = new System.Drawing.Point(5, 280);
            deleteSelectedBtn.Size = new System.Drawing.Size(200, 30);
            deleteSelectedBtn.Show();
            this.Controls.Add(deleteSelectedBtn);

            clearListBtn = new Button();
            clearListBtn.Text = "Clear list";
            clearListBtn.Click += HandleClearListBtnClick;
            clearListBtn.Location = new System.Drawing.Point(5, 315);
            clearListBtn.Size = new System.Drawing.Size(200, 30);
            clearListBtn.Show();
            this.Controls.Add(clearListBtn);

            fileSelectList = new CheckedListBox();
            fileSelectList.Location = new System.Drawing.Point(5, 5);
            fileSelectList.Size = new System.Drawing.Size(200, 200);
            fileSelectList.Show();
            this.Controls.Add(fileSelectList);

            startPresentationBtn = new Button();
            startPresentationBtn.Text = "Start Presentation";
            startPresentationBtn.Location = new System.Drawing.Point(250, 210);
            startPresentationBtn.Size = new System.Drawing.Size(200, 30);
            startPresentationBtn.Click += HandleStartPresentationBtnClick;
            startPresentationBtn.Show();
            this.Controls.Add(startPresentationBtn);

            Label numOfSecondsLbl = new Label();
            numOfSecondsLbl.Text = "Delay in seconds:";
            numOfSecondsLbl.Location = new System.Drawing.Point(250, 45);
            numOfSecondsLbl.Size = new System.Drawing.Size(100, 30);
            numOfSecondsLbl.Show();
            this.Controls.Add(numOfSecondsLbl);

            Label numOfTilesLbl = new Label();
            numOfTilesLbl.Text = "Number of tiles:";
            numOfTilesLbl.Location = new System.Drawing.Point(250, 85);
            numOfTilesLbl.Size = new System.Drawing.Size(100, 30);
            numOfTilesLbl.Show();
            this.Controls.Add(numOfTilesLbl);

            numOfTilesBox = new ComboBox();
            numOfTilesBox.DropDownStyle = ComboBoxStyle.DropDownList;
            for (int i = 1; i < 21; i++)
            {
                numOfTilesBox.Items.Add(i*i);
            }
            numOfTilesBox.SelectedItem = 16;
            numOfTilesBox.Location = new System.Drawing.Point(380, 85);
            numOfTilesBox.Size = new System.Drawing.Size(100, 30);
            numOfTilesBox.Show();
            this.Controls.Add(numOfTilesBox);

            secondsBox = new NumericUpDown();
            secondsBox.Maximum = 60;
            secondsBox.Minimum = 1;
            secondsBox.Value = 5;
            secondsBox.Location = new System.Drawing.Point(380, 45);
            secondsBox.Size = new System.Drawing.Size(100, 30);
            secondsBox.Show();
            this.Controls.Add(secondsBox);
        }