Answers
Apr 16, 2009 - 06:26 AM
Apr 17, 2009 - 06:08 AM
Nov 19, 2009 - 11:39 AM
Mar 15, 2010 - 03:08 AM
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
List
List
public Form1()
{
InitializeComponent();
NeededPoints = new List
FinalPoints = new List
}
bool StartFlag;
Graphics grph;
private void MainButton_Click(object sender, EventArgs e)
{
if (MainButton.Text == "Start")
{
StartFlag = true;
MainButton.Text = "Stop";
}
else
{
StartFlag = false;
MainButton.Text = "Start";
}
}
private void Form1_MouseClick(object sender, MouseEventArgs e)
{
if (StartFlag)
{
NeededPoints.Add(new Point(e.X, e.Y));
this.Invalidate(new Rectangle(new Point(0, 0), new Size(this.Width, this.Height - MainButton.Height)));
}
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
Point[] SelPoints;
if (NeededPoints.Count > 2)
{
grph = this.CreateGraphics();
SelPoints = NeededPoints.ToArray();
FinalPoints.Add(SelPoints);
foreach (Point[] ThreePoints in FinalPoints)
{
grph.DrawPolygon(Pens.Tomato, ThreePoints);
}
NeededPoints.Clear();
}
}
}
}
Mar 16, 2010 - 03:15 AM
Thanks again
Mar 16, 2010 - 05:34 PM
" What which I really mean from "wait" is that other buttons preforms no action before clicking all of the points ".You have complete power on what should happen when any button is pressed.In the code I gave you, you could add any other button and still execute some other actions regardless of what's happening with the form redrawing.Please explain yourself with a concrete example,maybe that way I'll be able to provide some useful help..
Daniel
Apr 13, 2010 - 12:17 PM
private void FillButton_Click(object sender, EventArgs e)
{
if (!StartFlag)
{
// Do Something
}
}
Thanks again
Dec 28, 2010 - 06:42 AM
Dec 28, 2010 - 06:43 AM
I’m not sure what you are talking about, but if you have computer problems or internet connection is very slow, you can try a software tuneup360, it's really helpful~~
Add New Comment