示例#1
0
 public void AgregarVentanaProceso(ProcesoInterfaz ventana, ToolStripMenuItem itemMenu)
 {
     escritorioPanel.Controls.Add(ventana);
     menuStrip1.Items.Add(itemMenu);
     ventana.BringToFront();
     ControlExtension.Draggable(ventana, true);
 }
示例#2
0
 public Form2()
 {
     InitializeComponent();
     ControlExtension.Draggable(this, true);
     //this.TransparencyKey = Color.Gray;
     //this.Opacity = 0.8;
 }
 private void buttonDrawByHand_Click(object sender, EventArgs e)
 {
     drawByHand = drawByHand == true ? false:true;
     //open
     if (drawByHand)
     {
         var button = (Button)sender;
         button.BackColor        = Color.Yellow;
         labelDrawByHand.Visible = true;
         for (int i = 1; i <= NodeCount; i++)
         {
             var nodeLabel = this.Controls.Find("label" + i, true)[0];
             ControlExtension.Draggable(nodeLabel, false);
         }
     }
     else
     //close
     {
         var button = (Button)sender;
         button.BackColor = Color.Gainsboro;
         for (int i = 1; i <= NodeCount; i++)
         {
             var nodeLabel = this.Controls.Find("label" + i, true)[0];
             ControlExtension.Draggable(nodeLabel, true);
         }
         clearSelected();
         labelDrawByHand.Visible = false;
     }
 }
示例#4
0
 public Form5(Login l)
 {
     InitializeComponent();
     this.l    = l;
     this.Text = "Створення нового лікаря";
     ControlExtension.Draggable(this, true);
 }
示例#5
0
 public Form15(Login l)
 {
     InitializeComponent();
     this.l = l;
     FillComboBox();
     ControlExtension.Draggable(this, true);
 }
示例#6
0
        private void panel2_DragDrop(object sender, DragEventArgs e)
        {
            Control copyControl = e.Data.GetData(e.Data.GetFormats()[0]) as Control;

            buttonUserControl aUserControl = new buttonUserControl();

            aUserControl.pic.Image = copyControl.BackgroundImage;
            aUserControl.lbl.Text  = "Table" + rnd.Next();

            aUserControl.Location = this.panel2.PointToClient(new Point(e.X, e.Y));
            // Declare rnd globally for creating random id for dynamic button(eg : Random rnd = new Random();)
            Button btn = new Button();

            btn.Name = "Button" + rnd.Next();

            if (copyControl != null)
            {
                btn.Text                  = copyControl.Text;
                btn.BackgroundImage       = copyControl.BackgroundImage;
                btn.BackgroundImageLayout = copyControl.BackgroundImageLayout;
                btn.Location              = this.panel2.PointToClient(new Point(e.X, e.Y));
                // btn.MouseMove += btn_MouseMove;
                //btn.MouseDown += new MouseEventHandler(btn_MouseDown);
                //   panel2.DragDrop +=panel2_DragDrop; ;
                //  btn.MouseDown += btn_MouseDown;
                ControlExtension.Draggable(aUserControl, true);

                this.panel2.Controls.Add(aUserControl);
            }
        }
示例#7
0
        //Otras funcionalidades
        private void Form1_Load(object sender, EventArgs e)
        {
            //Hago a todos los elementos arrastrables

            /*groupBox1.Width = (int)(this.Width * 0.6);
             * //groupBox1.Width = 30;*/
            textDireccion.Enabled = false;
            ControlExtension.Draggable(p8, true);
            ControlExtension.Draggable(p9, true);
            ControlExtension.Draggable(p10, true);
            ControlExtension.Draggable(p11, true);
            ControlExtension.Draggable(p12, true);
            ControlExtension.Draggable(p13, true);
            ControlExtension.Draggable(p5, true);
            ControlExtension.Draggable(p6, true);
            ControlExtension.Draggable(p7, true);
            ControlExtension.Draggable(p8, true);
            ControlExtension.Draggable(p11, true);
            ControlExtension.Draggable(p12, true);
            ControlExtension.Draggable(p1, true);
            //Cargo la tabla de productos en la pestaña mesas
            Item      i        = new Item();
            DataTable dt       = i.MostrarNombres();
            int       cantItem = dt.Rows.Count;

            for (int cont = 0; cont < cantItem; cont++)
            {
                comboBoxItem.Items.Add(dt.Rows[cont]["nombre"].ToString());
            }
        }
示例#8
0
        private void Level8_Load(object sender, EventArgs e)
        {
            suggestionText = "Nghĩ thoáng ra một chút, hãy dùng những thứ hiển thị trên màn hình !";
            answerText     = "Kỳ lạ nhỉ ?";

            ControlExtension.Draggable(label_Dot, true);
        }
示例#9
0
 private void form_StageN_Load(object sender, EventArgs e)
 {
     this.img = new PictureBox[5, 5] {
         { img00, img01, img02, img03, img04 },
         { img10, img11, img12, img13, img14 },
         { img20, img21, img22, img23, img24 },
         { img30, img31, img32, img33, img34 },
         { img40, img41, img42, img43, img44 }
     };
     this.defultLocal = new int[5, 5, 2];
     this.tempLocal   = new int[5, 5, 2];
     for (int i = 0; i < 5; ++i)
     {
         for (int j = 0; j < 5; ++j)
         {
             for (int k = 0; k < 2; ++k)
             {
                 ControlExtension.Draggable(img[i, j], true);
                 if (k == 0)
                 {
                     this.tempLocal[i, j, 0] = this.img[i, j].Location.X;
                 }
                 else
                 {
                     this.tempLocal[i, j, 1] = this.img[i, j].Location.Y;
                 }
             }
         }
     }
     this.Text  = this.username + this.stage.ToString();
     this.BaseX = imgBase.Location.X;
     this.BaseY = imgBase.Location.Y;
     this.hint  = 3;
     timer1.Start();
 }
示例#10
0
        public void CreateApplicance(string ApplianceName, Image OnPNG, Image OffPNG, float ElecUsage, float GasUsage, int FloorIndex)
        {
            Appliance APL = new Appliance();

            // Set Applicance properties
            APL.Toggled       = false;
            APL.FloorIndex    = FloorIndex;
            APL.OnPNG         = OnPNG;
            APL.OffPNG        = OffPNG;
            APL.ElecUsageRate = 0;
            APL.GasUsageRate  = 0;
            APL.ElecUntouch   = ElecUsage;
            APL.GasUntouch    = GasUsage;
            APL.Height        = 35;
            APL.Width         = 35;
            APL.SizeMode      = PictureBoxSizeMode.StretchImage;
            APL.Image         = APL.OffPNG;
            APL.Location      = SpawnLocation.Location;
            APL.Name          = ApplianceName;
            Controls.Add(APL);
            ApplianceList.Add(APL);
            APL.BringToFront();
            APL.Click += new EventHandler(Toggle);
            ControlExtension.Draggable(APL, true);
        }
示例#11
0
 public Form7(Form1 f, int action)
 {
     InitializeComponent();
     this.f1 = f;
     if (action == 1)
     {
         GetExpressHistory();
         this.Width      += 100;
         DG1.Width       += 100;
         button5.Location = new Point(button5.Location.X + 100, button5.Location.Y);
         label1.Location  = new Point(label1.Location.X + 100, label1.Location.Y);
         label1.Text      = "Всі експрес огляди";
     }
     else if (action == 2)
     {
         GetAllPatients();
         this.Width      -= 400;
         DG1.Width       -= 400;
         button5.Location = new Point(button5.Location.X - 400, button5.Location.Y);
         label1.Location  = new Point(label1.Location.X - 150, label1.Location.Y);
         label1.Text      = "Всі пацієнти";
     }
     form4 = false;
     ControlExtension.Draggable(this, true);
 }
示例#12
0
 public Form14(Login l, int id)
 {
     InitializeComponent();
     this.l  = l;
     this.id = id;
     ControlExtension.Draggable(this, true);
 }
示例#13
0
 public Form7(Form4 f)
 {
     InitializeComponent();
     this.f4 = f;
     GetHistory(f.patient.Id);
     form4 = true;
     ControlExtension.Draggable(this, true);
 }
示例#14
0
 private void Form1_Load(object sender, EventArgs e)
 {
     ControlExtension.Draggable(button1, true);
     ControlExtension.Draggable(txtImage, true);
     ControlExtension.Draggable(comboBox1, true);
     ControlExtension.Draggable(panel1, true);
     ControlExtension.Draggable(label1, true);
 }
示例#15
0
 public Form12(Login l)
 {
     InitializeComponent();
     this.l = l;
     GetDoctors(doctors);
     RenderDoctors();
     FillComboBox();
     ControlExtension.Draggable(this, true);
 }
示例#16
0
 private void Form1_Load(object sender, EventArgs e)
 {
     ControlExtension.Draggable(button1, true);
     ControlExtension.Draggable(textBox1, true);
     ControlExtension.Draggable(comboBox1, true);
     ControlExtension.Draggable(checkBox1, true);
     ControlExtension.Draggable(dataGridView1, true);
     ControlExtension.Draggable(progressBar1, true);
 }
示例#17
0
        private void Form1_Load(object sender, EventArgs e)
        {
            //Randomizing enemycamp terretories
            Random r = new Random();

            randomTerritories(r.Next(1, 4));
            //Creating obstacle menu
            pnlTitan.Enabled      = false;
            pnlAnza.Enabled       = false;
            pnlFlakpanzer.Enabled = false;
            pnlIronDome.Enabled   = false;
            pnlmachbet.Enabled    = false;
            pnlPatriot.Enabled    = false;
            pnlSpyder.Enabled     = false;
            pnlThel.Enabled       = false;
            ControlExtension.Draggable(pnlTitan, true);
            ControlExtension.Draggable(pnlAnza, true);
            ControlExtension.Draggable(pnlFlakpanzer, true);
            ControlExtension.Draggable(pnlIronDome, true);
            ControlExtension.Draggable(pnlmachbet, true);
            ControlExtension.Draggable(pnlPatriot, true);
            ControlExtension.Draggable(pnlSpyder, true);
            ControlExtension.Draggable(pnlThel, true);

            //Hiding zones (Obstacle zone, running strip)
            pnlAirStripStart.BorderStyle = BorderStyle.None;
            pbObstacleZone.BorderStyle   = BorderStyle.None;
            pnlEnemyBase.BorderStyle     = BorderStyle.None;
            pnlReturnBase.BorderStyle    = BorderStyle.None;
            pnlTitan.BorderStyle         = BorderStyle.None;
            pnlAnza.BorderStyle          = BorderStyle.None;
            pnlFlakpanzer.BorderStyle    = BorderStyle.None;
            pnlIronDome.BorderStyle      = BorderStyle.None;
            pnlmachbet.BorderStyle       = BorderStyle.None;
            pnlPatriot.BorderStyle       = BorderStyle.None;
            pnlSpyder.BorderStyle        = BorderStyle.None;
            pnlThel.BorderStyle          = BorderStyle.None;
            pnlHQBorder.BorderStyle      = BorderStyle.None;
            pnlTakeOff.BorderStyle       = BorderStyle.None;
            picJetAttack.BorderStyle     = BorderStyle.None;

            //Fuel Start
            FuelGauge.Value = 100;
            //Moving the jet to the start of the airstrip

            pnlAirStripStart.Hide();
            picJet.Location    = new Point(pnlAirStripStart.Location.X, pnlAirStripStart.Location.Y);
            picJet.BorderStyle = BorderStyle.None;
            //Rotating the jet

            Image imgJet = picJet.BackgroundImage;

            imgJet.RotateFlip(RotateFlipType.Rotate90FlipNone);
            picJet.BackgroundImage = imgJet;

            picJetAttack.Hide();
        }
示例#18
0
 public Diagram(Login l)
 {
     InitializeComponent();
     this.l = l;
     first  = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
     BuildDiagram();
     BuildDiagramLastMonth();
     ControlExtension.Draggable(this, true);
 }
示例#19
0
        private void Level2_Load(object sender, EventArgs e)
        {
            suggestionText = "Màu xanh lục có thể pha từ màu gì nhỉ ??!";
            answerText     = "Nước đi hay lắm !";

            ControlExtension.Draggable(picture_RedPencil, true);
            ControlExtension.Draggable(picture_BluePencil, true);
            ControlExtension.Draggable(picture_YellowPencil, true);
        }
示例#20
0
 public Form16(Login l)
 {
     InitializeComponent();
     this.l = l;
     comboBox1.SelectedIndex = 0;
     GetDirections();
     SelectAll();
     ControlExtension.Draggable(this, true);
 }
示例#21
0
        private void Level1_Load(object sender, EventArgs e)
        {
            suggestionText = "Chú ý là hoa quả nhé :3";
            answerText     = "Tất nhiên cà rốt không thể là hoa quả rồi !";

            ControlExtension.Draggable(btn_QuaDua, true);
            ControlExtension.Draggable(btn_CaRot, true);
            ControlExtension.Draggable(btn_QuaTao, true);
        }
示例#22
0
 private void Home_Load(object sender, EventArgs e)
 {
     cmd.Connection = con;                  //select a database to select table
     con.Open();
     cmd.CommandType    = CommandType.Text; //to define it is a string
     cmd.CommandTimeout = 15;
     ControlExtension.Draggable(button1, true);
     con.Close();
     groupBox1.SendToBack();
 }
示例#23
0
 public Form13(Login l, int id)
 {
     InitializeComponent();
     comboBox1.SelectedIndex = 0;
     this.l  = l;
     this.id = id;
     GetSchedule(table);
     RenderThisWeek();
     ControlExtension.Draggable(this, true);
 }
示例#24
0
        public Form10(Login f)
        {
            InitializeComponent();
            this.f = f;

            textBox1.Text = f.settings.DataSource;
            textBox2.Text = f.settings.InitialCatalog;
            textBox3.Text = f.settings.UserID;
            textBox4.Text = f.settings.Password;
            ControlExtension.Draggable(this, true);
        }
示例#25
0
        public void AddDev03()
        {
            ucDevice ucd = new ucDevice();

            ucd.Parent  = panelDevicesss;
            ucd.picture = imageListDevice.Images[2];
            ucd.NameDev = "БМРЗ-150";
            ucd.Top     = 100;
            ucd.Left    = 150;
            ControlExtension.Draggable(ucd, true);
        }
示例#26
0
 public Form5(Login l, int id)
 {
     InitializeComponent();
     this.l         = l;
     editing        = true;
     label1.Visible = false;
     this.id        = id;
     GetDoctor();
     this.Text = "Редагування лікаря";
     ControlExtension.Draggable(this, true);
 }
示例#27
0
文件: Form1.cs 项目: c3l1l/scrum
        private void button1_Click(object sender, EventArgs e)
        {
            Panel pnl1 = new Panel();

            pnl1.Location  = new Point(485, 20);
            pnl1.Width     = 230;
            pnl1.Height    = 140;
            pnl1.BackColor = Color.DarkGray;
            ControlExtension.Draggable(pnl1, true);
            Label lbl1 = new Label();

            lbl1.Text     = "Story No:";
            lbl1.Location = new Point(3, 5);
            lbl1.Width    = 55;
            lbl1.Height   = 13;

            NumericUpDown nud1 = new NumericUpDown();

            nud1.Location = new Point(61, 3);
            nud1.Width    = 30;
            nud1.Height   = 20;
            TextBox txt2 = new TextBox();

            txt2.Width     = 224;
            txt2.Height    = 90;
            txt2.Text      = "Description";
            txt2.Location  = new Point(3, 45);
            txt2.Multiline = true;
            Label lbl2 = new Label();

            lbl2.Text     = "Date:";
            lbl2.Location = new Point(3, 26);
            lbl2.Width    = 55;
            lbl2.Height   = 13;
            DateTimePicker dtp = new DateTimePicker();

            dtp.Format   = DateTimePickerFormat.Short;
            dtp.Location = new Point(61, 24);
            dtp.Width    = 80;
            dtp.Height   = 20;
            TextBox txt1 = new TextBox();

            txt1.Width    = 80;
            txt1.Height   = 20;
            txt1.Text     = "Tag";
            txt1.Location = new Point(100, 3);
            pnl1.Controls.Add(txt2);
            pnl1.Controls.Add(nud1);
            pnl1.Controls.Add(lbl1);
            pnl1.Controls.Add(lbl2);
            pnl1.Controls.Add(txt1);
            pnl1.Controls.Add(dtp);
            this.Controls.Add(pnl1);
        }
示例#28
0
        public Form4_2(Form4 f)
        {
            InitializeComponent();
            this.f = f;

            dateTimePicker3.Value = DateTime.Now.Date;
            dateTimePicker4.Value = DateTime.Now.Date;
            begin         = DateTime.Now.ToString("HH:mm");
            textBox2.Text = f.patient.Mail;
            GetDoctors();
            ControlExtension.Draggable(this, true);
        }
示例#29
0
 private void FormWebBrowser_Load(object sender, EventArgs e)
 {
     try
     {
         ControlExtension.Draggable(this, true);
         tbUrl.Text           = @"https://www.google.com/";
         webBrowserScreen.Url = new Uri(tbUrl.Text);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, ex.Source, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
示例#30
0
 public Form8(Login l)
 {
     InitializeComponent();
     this.l = l;
     if (l.doc.Position == "Головний лікар")
     {
         label3.Visible  = true;
         button1.Visible = true;
         button2.Visible = true;
     }
     GetDoctors();
     ControlExtension.Draggable(this, true);
 }