示例#1
0
 // </Snippet1>
 // <Snippet2>
 private void DrawOval()
 {
     // Declare an OvalShape and parent it to LineShape1's ShapeContainer.
     Microsoft.VisualBasic.PowerPacks.OvalShape oval1 =
         new Microsoft.VisualBasic.PowerPacks.OvalShape(lineShape1.Parent);
     // Set the location and size of the oval.
     oval1.Left   = 10;
     oval1.Top    = 10;
     oval1.Width  = 100;
     oval1.Height = 200;
 }
示例#2
0
 // </Snippet2>
 // <Snippet3>
 private void DrawCircle2()
 {
     Microsoft.VisualBasic.PowerPacks.ShapeContainer canvas =
         new Microsoft.VisualBasic.PowerPacks.ShapeContainer();
     // Declare an OvalShape and set the location and size.
     Microsoft.VisualBasic.PowerPacks.OvalShape oval1 =
         new Microsoft.VisualBasic.PowerPacks.OvalShape(20, 20, 120, 120);
     // Set the form as the parent of the ShapeContainer.
     canvas.Parent = this;
     // Set the ShapeContainer as the parent of the OvalShape.
     oval1.Parent = canvas;
 }
示例#3
0
        private bool CheckIfAwake(SecretariatServiceClient client, Microsoft.VisualBasic.PowerPacks.OvalShape oval)
        {
            oval.FillStyle = Microsoft.VisualBasic.PowerPacks.FillStyle.Solid;

            if (client.CheckConnection() == "Ack")
            {
                oval.FillColor = Color.Green;
                return(true);
            }
            else
            {
                oval.FillColor = Color.Red;
                return(false);
            }
        }
示例#4
0
        //----------------------------------------------------------------------------------------------------------------
        //Форма
        public Form1()
        {
            InitializeComponent();
            x1 = y1 = x2 = y2 = 0;
            for (int i = 0; i < 50; i++)
                for (int j = 0; j < 50; j++)
                    matrix_sumizn[i, j] = 0;

            //створення точок
            for (int i = 0; i < n; i++)
            {
                ovalshape[i] = new Microsoft.VisualBasic.PowerPacks.OvalShape();
                ovalshape[i].BackColor = Color.Red;
                ovalshape[i].BackStyle = Microsoft.VisualBasic.PowerPacks.BackStyle.Opaque;
                ovalshape[i].Size = new Size(25, 25);
                ovalshape[i].Visible = true;
                ovalshape[i].ContextMenuStrip = contextMenuStrip2;
                ovalshape[i].Name = i.ToString();
                ovalshape[i].MouseClick += new MouseEventHandler(ovalshape_MouseClick);
            }
            //-----------------------------------------------------------------------------
            //Створення полів дя вuводу назв населених пунктів
            for (int i = 0; i < n; i++)
            {
                tb[i] = new TextBox();
                tb[i].Size = new Size(50, 20);
                tb[i].Name = i.ToString();
                tb[i].Text = "Пункт " + ((char)('A' + i)).ToString();
            }
            //------------------------------------------------------------------------------
            //Створення ліній
            for (int i = 0; i < n; i++)
            {
                lineshape[i] = new Microsoft.VisualBasic.PowerPacks.LineShape();
                lineshape[i].Name = i.ToString();
            }
            //------------------------------------------------------------------------------
            //Створення текстових полів для введення величин
            for (int i = 0; i < n; i++)
            {
                tb_length[i] = new TextBox();
                tb_length[i].Size = new Size(50, 20);
                tb_length[i].Name = i.ToString();
                tb_length[i].Text = "1";
            }
            //------------------------------------------------------------------------------
            MouseClick += new MouseEventHandler(Form1_MouseClick);
        }
示例#5
0
 // <Snippet1>
 private void DrawCircle1()
 {
     Microsoft.VisualBasic.PowerPacks.ShapeContainer canvas =
         new Microsoft.VisualBasic.PowerPacks.ShapeContainer();
     Microsoft.VisualBasic.PowerPacks.OvalShape oval1 =
         new Microsoft.VisualBasic.PowerPacks.OvalShape();
     // Set the form as the parent of the ShapeContainer.
     canvas.Parent = this;
     // Set the ShapeContainer as the parent of the OvalShape.
     oval1.Parent = canvas;
     // Set the location and size of the circle.
     oval1.Left   = 10;
     oval1.Top    = 10;
     oval1.Width  = 100;
     oval1.Height = 100;
 }
示例#6
0
        public void setColor(Microsoft.VisualBasic.PowerPacks.OvalShape oval, double quality)
        {
            if (quality == 0)
            {
                oval.FillColor = Color.Black;
            }

            else if (quality == 1)
            {
                oval.FillColor = Color.Red;
            }
            else if (quality == 2)
            {
                oval.FillColor = Color.Orange;
            }
            else if (quality == 3)
            {
                oval.FillColor = Color.Yellow;
            }
            else if (quality == 4)
            {
                oval.FillColor = Color.Green;
            }
        }
示例#7
0
 void ovalshape_MouseClick(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right)
     {
         dz_ovalshape = (Microsoft.VisualBasic.PowerPacks.OvalShape)sender;
         conect_ovalshape1 = sender;
     }
     else if (!mouseRight && (e.Button == MouseButtons.Left))
     {
         dz_ovalshape = (Microsoft.VisualBasic.PowerPacks.OvalShape)sender;
         conect_ovalshape1 = sender;
         dz_ovalshape.BackColor = Color.Green;
         this.зєднатиToolStripMenuItem_Click(sender, e);
     }
 }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.Windows.Forms.Label label2;
     this.button1 = new System.Windows.Forms.Button();
     this.comboBox1 = new System.Windows.Forms.ComboBox();
     this.label1 = new System.Windows.Forms.Label();
     this.trackBar1 = new System.Windows.Forms.TrackBar();
     this.shapeContainer1 = new Microsoft.VisualBasic.PowerPacks.ShapeContainer();
     this.ovalShape1 = new Microsoft.VisualBasic.PowerPacks.OvalShape();
     this.timer1 = new System.Windows.Forms.Timer(this.components);
     label2 = new System.Windows.Forms.Label();
     ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit();
     this.SuspendLayout();
     //
     // label2
     //
     label2.AutoSize = true;
     label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     label2.Location = new System.Drawing.Point(57, 75);
     label2.Name = "label2";
     label2.Size = new System.Drawing.Size(171, 18);
     label2.TabIndex = 6;
     label2.Text = "Choose Your IP Address";
     //
     // button1
     //
     this.button1.Location = new System.Drawing.Point(12, 205);
     this.button1.Name = "button1";
     this.button1.Size = new System.Drawing.Size(112, 44);
     this.button1.TabIndex = 0;
     this.button1.Text = "Start Listening";
     this.button1.UseVisualStyleBackColor = true;
     this.button1.Click += new System.EventHandler(this.button1_Click);
     //
     // comboBox1
     //
     this.comboBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.comboBox1.FormattingEnabled = true;
     this.comboBox1.Location = new System.Drawing.Point(53, 98);
     this.comboBox1.Name = "comboBox1";
     this.comboBox1.Size = new System.Drawing.Size(179, 26);
     this.comboBox1.TabIndex = 2;
     this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
     //
     // label1
     //
     this.label1.AutoEllipsis = true;
     this.label1.AutoSize = true;
     this.label1.Location = new System.Drawing.Point(98, 134);
     this.label1.Margin = new System.Windows.Forms.Padding(0);
     this.label1.Name = "label1";
     this.label1.Size = new System.Drawing.Size(0, 13);
     this.label1.TabIndex = 0;
     this.label1.TextAlign = System.Drawing.ContentAlignment.TopCenter;
     //
     // trackBar1
     //
     this.trackBar1.LargeChange = 2;
     this.trackBar1.Location = new System.Drawing.Point(0, 157);
     this.trackBar1.Name = "trackBar1";
     this.trackBar1.Size = new System.Drawing.Size(283, 45);
     this.trackBar1.TabIndex = 4;
     this.trackBar1.Value = 5;
     this.trackBar1.Scroll += new System.EventHandler(this.trackBar1_Scroll);
     //
     // shapeContainer1
     //
     this.shapeContainer1.Location = new System.Drawing.Point(0, 0);
     this.shapeContainer1.Margin = new System.Windows.Forms.Padding(0);
     this.shapeContainer1.Name = "shapeContainer1";
     this.shapeContainer1.Shapes.AddRange(new Microsoft.VisualBasic.PowerPacks.Shape[] {
     this.ovalShape1});
     this.shapeContainer1.Size = new System.Drawing.Size(284, 261);
     this.shapeContainer1.TabIndex = 5;
     this.shapeContainer1.TabStop = false;
     //
     // ovalShape1
     //
     this.ovalShape1.BackStyle = Microsoft.VisualBasic.PowerPacks.BackStyle.Opaque;
     this.ovalShape1.BorderColor = System.Drawing.SystemColors.Control;
     this.ovalShape1.FillColor = System.Drawing.Color.Red;
     this.ovalShape1.FillStyle = Microsoft.VisualBasic.PowerPacks.FillStyle.Solid;
     this.ovalShape1.Location = new System.Drawing.Point(129, 215);
     this.ovalShape1.Name = "ovalShape1";
     this.ovalShape1.Size = new System.Drawing.Size(23, 23);
     //
     // timer1
     //
     this.timer1.Enabled = true;
     this.timer1.Interval = 10;
     this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
     //
     // Form1
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize = new System.Drawing.Size(284, 261);
     this.Controls.Add(label2);
     this.Controls.Add(this.trackBar1);
     this.Controls.Add(this.label1);
     this.Controls.Add(this.comboBox1);
     this.Controls.Add(this.button1);
     this.Controls.Add(this.shapeContainer1);
     this.Name = "Form1";
     this.Text = "Form1";
     this.Load += new System.EventHandler(this.Form1_Load);
     ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit();
     this.ResumeLayout(false);
     this.PerformLayout();
 }