Text: |
ԲΠ= Áàòàð÷óóê
Çàïèòàííÿ:Ðåàë³çóâàòè ï³äðàõóíîê â³äñòàí³ ì³æ òî÷êàìè äâîõ ï³äðÿä íàòèñêàíü ïðàâî¿ êíîïêè ìèø³
====================================
ANSWER ====================================
http://radfiz.org.ua/share/op/ekz_prg/batarchuk.rar
END of ANSWER ====================================
ANSWER ====================================
private void Form1_MouseClick(object sender, MouseEventArgs e)
{
if (Convert.ToString(e.Button) == "Right")
{
if (count == 0)
{
x1 = e.X;
y1 = e.Y;
count++;
return;
}
if (count == 1)
{
x2 = e.X;
y2 = e.Y;
count = 0;
double rez = Math.Sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
this.Text = Convert.ToString(x1) + "x" + Convert.ToString(y1) + " - " + Convert.ToString(x2) + "x" + Convert.ToString(y2) + " = " + Convert.ToString(rez);
return;
}
}
END of ANSWER ====================================
|