Make your own free website on Tripod.com

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

class Movimiento:Form
{

Point ptMouse=Point.Empty;
public static void Main()
{
Application.Run(new Movimiento());
}
public Movimiento()
{
Text="Movimiento del Raton ";
BackColor=SystemColors.Window;
ForeColor=SystemColors.WindowText;
ResizeRedraw=true;

}
protected override void OnMouseMove(MouseEventArgs e)
{
Graphics grfx=CreateGraphics();

DrawWeb(grfx,BackColor,ptMouse);
ptMouse=new Point(e.X,e.Y);

DrawWeb(grfx,ForeColor,ptMouse);

grfx.Dispose();

}


protected override void OnPaint(PaintEventArgs e)
{

DrawWeb(e.Graphics,ForeColor,ptMouse);
}

void DrawWeb(Graphics grfx,Color clr,Point pt)
{
Pen pen=new Pen(clr);
int cx=ClientSize.Width;
int cy=ClientSize.Height;
grfx.DrawLine(pen,pt,new Point(0,0));
grfx.DrawLine(pen,pt,new Point(cx/4,0));
grfx.DrawLine(pen,pt,new Point(cx/2,0));
grfx.DrawLine(pen,pt,new Point(3*cx/4,0));
grfx.DrawLine(pen,pt,new Point(cx,0));
grfx.DrawLine(pen,pt,new Point(cx,cy/4));
grfx.DrawLine(pen,pt,new Point(cx,cy/2));
grfx.DrawLine(pen,pt,new Point(cx,3*cy/4));
grfx.DrawLine(pen,pt,new Point(cx,cy));
grfx.DrawLine(pen,pt,new Point(3*cx/4,cy));
grfx.DrawLine(pen,pt,new Point(cx/2,cy));
grfx.DrawLine(pen,pt,new Point(cx/4,cy));
grfx.DrawLine(pen,pt,new Point(0,cy));
grfx.DrawLine(pen,pt,new Point(0,cy/4));
grfx.DrawLine(pen,pt,new Point(0,cy/2));
grfx.DrawLine(pen,pt,new Point(0,3*cy/4));



}



}

Este programa lo que hace es dibujar varias lineas las cuales se juntan, y donde todas se conjuntan al pasar el MOUSE sobre la ventana seguiran las coordenadas del puntero hacia donde se mueva.