Treceți la conținutul principal

dummySquaredShape drawing sample cnet listing code

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DummyTransparentObject

{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            dummyControlSquared.Height = 1;
            dummyControlSquared.Width = 1;
        }
        bool moveMouse = false;
        bool downMouse = false;
        bool upMouse = false;
        int x1, x2, y1, y2;

        private void Form1_MouseDown(object sender, MouseEventArgs e)

        {
            downMouse = true; 
            upMouse = false;
            x1 = e.X;
            y1 = e.Y;
        }

        private void Form1_MouseMove(object sender, MouseEventArgs e)

        {
            moveMouse = true;
            if (downMouse == false && moveMouse == true)
            {
                dummyControlSquared.Left = e.X-1;
                dummyControlSquared.Top = e.Y-1;
            }
            if(moveMouse == true && downMouse == true)
            {
             
                x2 = e.X;
                y2 = e.Y;
                dummyControlSquared.Width = x2 - x1;
                dummyControlSquared.Height = y2 - y1;
            }
        }

        private void Form1_MouseUp(object sender, MouseEventArgs e)

        {
            upMouse = true; 
            downMouse = false; 
            moveMouse = false;
            dummyControlSquared.Width = 1;
            dummyControlSquared.Height = 1;
            x2 = 1;
            y2 = 1;
        }
    }
}






/////


code control user defined 


////



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DummyObjectTansparent
{
    public partial class UserControl1 : UserControl
    {

        Graphics g;
      
       
        Pen pen0 = new Pen(Color.Black);

        public UserControl1()
        {
            InitializeComponent();
        }

       
        private void UserControl1_Load(object sender, EventArgs e)
        {

        }

        private void UserControl1_Paint(object sender, PaintEventArgs e)
        {
          g = e.Graphics;
         
            g.DrawEllipse(pen0, 0, 0, Width-3, Height-3);
            g.DrawLine(pen0, (Width / 2), (Height / 2)+1, (Width / 2), (Height / 2)-1);
            g.DrawLine(pen0, (Width / 2) + 1, (Height / 2), (Width / 2) - 1, (Height / 2));
        }

        private void UserControl1_Resize(object sender, EventArgs e)
        {
            Refresh();
        }
    }
}


Comentarii

Postări populare de pe acest blog

program principal cpp

#include "clasa.h" #include <stdio.h> #include <conio.h> #include <stdlib.h> #include <string.h> #define DELAY 9000000 void delay() { for(long i=0;i<DELAY;i++); } //constructor cu initializare de la tastatura BigInt::BigInt() {char x; signed char t[400]; int i; printf("\nNumarul cu semn "); do s=getche(); while((s!='+')&&(s!='-')); n=0; do {x=getche(); t[n]=x-'0'; n++; } while((x>='0')&&(x<='9')); n--; for(i=0;i<n;i++) nr[i]=t[n-i-1]; } //constructor cu initializare prin parametri BigInt::BigInt(char semn,signed char numar[],int dim) {int i; s=semn; n=dim; for(i=0;i<n;i++) nr[i]=numar[n-i-1]; } //transform un int negativ in pozitiv int BigInt::Pozitiv(int x) {int a,vb; a=0; vb=0; while(vb==0) if((x+a)==0) vb=1; else a=a+1; x=a; return x; } //constructor dintr-un nr int obisnuit BigInt::BigInt(int x) {int i; if(x>=0) s='+'…

NUMERE PRIME ALGORITM C++

// NUMERE PRIME ALGORITM C++//  reediting from scratch //on this page is just the study for a next algoritm for generating the parime nr series like Fibonnaci or ....if possibile

74111121313417374414124343447 if u know the red part you can generate the orange part
1 0 1 111112222 1 1 23

o aplicatie php localitati romania

//APLICATIA SE REFERA LA BAZA DE DATE SIRUTA

//dragtable.js


/* dragtable v1.0 June 26, 2008 Dan Vanderkam, http://danvk.org/dragtable/ http://code.google.com/p/dragtable/ \Bsortabledraggable\B Instructions: - Download this file - Add <script src="dragtable.js"></script> to your HTML. - Add class="draggable" to any table you might like to reorder. - Drag the headers around to reorder them. This is code was based on: - Stuart Langridge's SortTable (kryogenix.org/code/browser/sorttable) - Mike Hall's draggable class (http://www.brainjar.com/dhtml/drag/) - A discussion of permuting table columns on comp.lang.javascript Licensed under the MIT license. */ // Here's the notice from Mike Hall's draggable script: //***************************************************************************** // Do not remove this notice. // // Copyright 2001 by Mike Hall. // See http…