Recherche sou C#

Résolu
molkaH - 15 févr. 2013 à 12:44
 molkaH - 15 févr. 2013 à 15:49
Bonjour à tous,
Je suis une étudiante et je travaille dans mon projet de fin d'études sur Visual basic C#, j'ai le code ci-dessous et je veux pouvoir lui ajouter un tableau et une fonction qui me permettent de dessiner trois cercles ou plus et qui ne sont pas identiques mais j'arrive pas à faire cela avec succès s'il vous plait pouvez vous m'aider
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;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Input;

namespace cirleonmouseover
{
public partial class Form1 : Form
{
Point MyCircleCenter = new Point(100, 50);
Size MyCircleRay = new Size(75, 75);
// Must be the same values to generate a circle.
private GraphicsPath MyCircle;

public Form1()
{
InitializeComponent();
MyCircle = new GraphicsPath();
MyCircle.AddEllipse(5, 5, 50, 50);
// circle of radius 2.5 at (5,5)
this.MouseClick += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseClick);
}

private void button1_Click(object sender, EventArgs e)
{

}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
e.Graphics.DrawPath(Pens.Black, MyCircle);

}
private void Form1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
// If distance from center is higher than circle ray, it's outside thecircle.
if(MyCircle.IsVisible(e.X, e.Y))
{
richTextBox1.AppendText("-In circle");
}
else
richTextBox1.AppendText("-Out circle");
}

private void Form1_Load(object sender, EventArgs e)
{

}
}

}
Merci d'avance

3 réponses

Bonjour à tous,
Je suis une étudiante et je travaille dans mon projet de fin d’études sur Visual basic C#, j’ai le code ci-dessous et je veux pouvoir lui ajouter un tableau et une fonction qui me permettent de dessiner trois cercles ou plus et qui ne sont pas identiques mais j'arrive pas à faire cela avec succès s'il vous plait pouvez vous m'aider
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;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Input;

namespace cirleonmouseover
{
public partial class Form1 : Form
{
Point MyCircleCenter = new Point(100, 50);
Size MyCircleRay = new Size(75, 75);
// Must be the same values to generate a circle.
private GraphicsPath MyCircle;

public Form1()
{
InitializeComponent();
MyCircle = new GraphicsPath();
MyCircle.AddEllipse(5, 5, 50, 50);
// circle of radius 2.5 at (5,5)
this.MouseClick += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseClick);
}

private void button1_Click(object sender, EventArgs e)
{

}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
e.Graphics.DrawPath(Pens.Black, MyCircle);

}
private void Form1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
// If distance from center is higher than circle ray, it's outside thecircle.
if(MyCircle.IsVisible(e.X, e.Y))
{
richTextBox1.AppendText("-In circle");
}
else
richTextBox1.AppendText("-Out circle");
}

private void Form1_Load(object sender, EventArgs e)
{

}
}

}
Merci d'avance
3
Salut molkaH,
si tu veux de l aide en C# poste ta Question dans le Forum de c# pas ici

int mindongo
0
ok merci
0
Rejoignez-nous