hi all please i need help
i had create new map i create (NFM & FNC) and all the photos for map but NFA i can't create one i search so much all program i found not good to greate new one
i find Programming for NFA By dream
this the programmig if anyone can create this program please help me and do this ^^
Drawing by clicking
Code:
private void checkBox3_CheckedChanged(object sender, EventArgs e)
{
if (checkBox3.Checked == true)
{
if (this.dataGridView4.Rows[0].Cells[0].Value == null)
{
num_nfa = 1;
}
else
{
num_nfa = Convert.ToInt32(this.dataGridView4.Rows[dataGridView4.RowCount - 2].Cells[0].Value) + 1;
}
}
if (checkBox3.Checked == false)
{
for (int i = 0; i < dataGridView4.RowCount - 1; i++)
{
if (Convert.ToInt32(this.dataGridView4.Rows[i].Cells[0].Value) == num_nfa)
{
this.dataGridView4.Rows[i].Cells[3].Value = count_nfa;
}
}
count_nfa = 0;
}
}
private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
{
if (checkBox3.Checked == true)
{
x1 = e.X;
y1 = e.Y;
dataGridView4.Rows.Add();
this.dataGridView4.Rows[dataGridView4.RowCount - 2].Cells[0].Value = num_nfa;
this.dataGridView4.Rows[dataGridView4.RowCount - 2].Cells[1].Value = x1;
this.dataGridView4.Rows[dataGridView4.RowCount - 2].Cells[2].Value = 3072 - y1;
count_nfa += 1;
}
}
private void pictureBox1_MouseUp(object sender, MouseEventArgs e)
{
if (checkBox3.Checked == true)
{
if (count_nfa > 1)
{
pictureBox1.Refresh();
}
}
}
private void pictureBox1_Paint(object sender, PaintEventArgs e)
{
if (onnfa == 1)
{
//nfa
int num = 0;
int xnfa = Convert.ToInt32(this.dataGridView4.Rows[0].Cells[1].Value.ToString());
int ynfa = Convert.ToInt32(this.dataGridView4.Rows[0].Cells[2].Value.ToString());
for (int i = 0; i < (dataGridView4.RowCount - 2); i++)
{
num = Convert.ToInt32(this.dataGridView4.Rows[i].Cells[0].Value.ToString());
if (num == (Convert.ToInt32(this.dataGridView4.Rows[i + 1].Cells[0].Value.ToString())))
{
Graphics g = e.Graphics;
g.DrawLine(System.Drawing.Pens.Red, (Convert.ToInt32(this.dataGridView4.Rows[i].Cells[1].Value.ToString())), 3072 - (Convert.ToInt32(this.dataGridView4.Rows[i].Cells[2].Value.ToString())), (Convert.ToInt32(this.dataGridView4.Rows[i + 1].Cells[1].Value.ToString())), 3072 - (Convert.ToInt32(this.dataGridView4.Rows[i + 1].Cells[2].Value.ToString())));
}
else
{
Graphics g = e.Graphics;
g.DrawLine(System.Drawing.Pens.Red, (Convert.ToInt32(this.dataGridView4.Rows[i].Cells[1].Value.ToString())), 3072 - (Convert.ToInt32(this.dataGridView4.Rows[i].Cells[2].Value.ToString())), xnfa, 3072 - ynfa);
g.DrawString(Convert.ToString(this.dataGridView4.Rows[i].Cells[0].Value.ToString()), new Font("Helvetica", 7), Brushes.Red, xnfa, 3072 - ynfa);
g.DrawLine(System.Drawing.Pens.Red, (Convert.ToInt32(this.dataGridView4.Rows[i+1].Cells[1].Value.ToString())), 3072 - (Convert.ToInt32(this.dataGridView4.Rows[i+1].Cells[2].Value.ToString())), (Convert.ToInt32(this.dataGridView4.Rows[i + 2].Cells[1].Value.ToString())), 3072 - (Convert.ToInt32(this.dataGridView4.Rows[i + 2].Cells[2].Value.ToString())));
xnfa = Convert.ToInt32(this.dataGridView4.Rows[i + 1].Cells[1].Value.ToString());
ynfa = Convert.ToInt32(this.dataGridView4.Rows[i + 1].Cells[2].Value.ToString());
}
}
Graphics p = e.Graphics;
p.DrawLine(System.Drawing.Pens.Red, (Convert.ToInt32(this.dataGridView4.Rows[dataGridView4.RowCount - 2].Cells[1].Value.ToString())), 3072 - (Convert.ToInt32(this.dataGridView4.Rows[dataGridView4.RowCount - 2].Cells[2].Value.ToString())), xnfa, 3072 - ynfa);
p.DrawString(Convert.ToString(this.dataGridView4.Rows[dataGridView4.RowCount - 2].Cells[0].Value.ToString()), new Font("Helvetica", 7), Brushes.Red, xnfa, 3072 - ynfa);
//nfa
}
}
Code:
private void checkBox8_CheckedChanged(object sender, EventArgs e)
{
if (checkBox8.Checked == true)
{
if (this.dataGridView4.Rows[0].Cells[0].Value == null)
{
num_nfa = 1;
}
else
{
num_nfa = Convert.ToInt32(this.dataGridView4.Rows[dataGridView4.RowCount - 2].Cells[0].Value) + 1;
}
}
if (checkBox8.Checked == false)
{
for (int i = 0; i < dataGridView4.RowCount - 1; i++)
{
if (Convert.ToInt32(this.dataGridView4.Rows[i].Cells[0].Value) == num_nfa)
{
this.dataGridView4.Rows[i].Cells[3].Value = count_nfa;
}
}
count_nfa = 0;
}
}
private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
{
if (checkBox8.Checked == true)
{
doDraw = true;
}
}
private void pictureBox1_MouseUp(object sender, MouseEventArgs e)
{
if (checkBox8.Checked == true)
{
doDraw = false;
}
}
private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
{
if (checkBox8.Checked == true)
{
if (doDraw)
{
x1 = e.X;
y1 = e.Y;
dataGridView4.Rows.Add();
this.dataGridView4.Rows[dataGridView4.RowCount - 2].Cells[0].Value = num_nfa;
this.dataGridView4.Rows[dataGridView4.RowCount - 2].Cells[1].Value = x1;
this.dataGridView4.Rows[dataGridView4.RowCount - 2].Cells[2].Value = 3072 - y1;
count_nfa += 1;
if (count_nfa > 1)
{
pictureBox1.Refresh();
}
}
}
}
private void pictureBox1_Paint(object sender, PaintEventArgs e)
{
if (onnfa == 1)
{
//nfa
int num = 0;
int xnfa = Convert.ToInt32(this.dataGridView4.Rows[0].Cells[1].Value.ToString());
int ynfa = Convert.ToInt32(this.dataGridView4.Rows[0].Cells[2].Value.ToString());
for (int i = 0; i < (dataGridView4.RowCount - 2); i++)
{
num = Convert.ToInt32(this.dataGridView4.Rows[i].Cells[0].Value.ToString());
if (num == (Convert.ToInt32(this.dataGridView4.Rows[i + 1].Cells[0].Value.ToString())))
{
Graphics g = e.Graphics;
g.DrawLine(System.Drawing.Pens.Red, (Convert.ToInt32(this.dataGridView4.Rows[i].Cells[1].Value.ToString())), 3072 - (Convert.ToInt32(this.dataGridView4.Rows[i].Cells[2].Value.ToString())), (Convert.ToInt32(this.dataGridView4.Rows[i + 1].Cells[1].Value.ToString())), 3072 - (Convert.ToInt32(this.dataGridView4.Rows[i + 1].Cells[2].Value.ToString())));
}
else
{
Graphics g = e.Graphics;
g.DrawLine(System.Drawing.Pens.Red, (Convert.ToInt32(this.dataGridView4.Rows[i].Cells[1].Value.ToString())), 3072 - (Convert.ToInt32(this.dataGridView4.Rows[i].Cells[2].Value.ToString())), xnfa, 3072 - ynfa);
g.DrawString(Convert.ToString(this.dataGridView4.Rows[i].Cells[0].Value.ToString()), new Font("Helvetica", 7), Brushes.Red, xnfa, 3072 - ynfa);
g.DrawLine(System.Drawing.Pens.Red, (Convert.ToInt32(this.dataGridView4.Rows[i+1].Cells[1].Value.ToString())), 3072 - (Convert.ToInt32(this.dataGridView4.Rows[i+1].Cells[2].Value.ToString())), (Convert.ToInt32(this.dataGridView4.Rows[i + 2].Cells[1].Value.ToString())), 3072 - (Convert.ToInt32(this.dataGridView4.Rows[i + 2].Cells[2].Value.ToString())));
xnfa = Convert.ToInt32(this.dataGridView4.Rows[i + 1].Cells[1].Value.ToString());
ynfa = Convert.ToInt32(this.dataGridView4.Rows[i + 1].Cells[2].Value.ToString());
}
}
Graphics p = e.Graphics;
p.DrawLine(System.Drawing.Pens.Red, (Convert.ToInt32(this.dataGridView4.Rows[dataGridView4.RowCount - 2].Cells[1].Value.ToString())), 3072 - (Convert.ToInt32(this.dataGridView4.Rows[dataGridView4.RowCount - 2].Cells[2].Value.ToString())), xnfa, 3072 - ynfa);
p.DrawString(Convert.ToString(this.dataGridView4.Rows[dataGridView4.RowCount - 2].Cells[0].Value.ToString()), new Font("Helvetica", 7), Brushes.Red, xnfa, 3072 - ynfa);
//nfa
}
}
thanks and Sorry for bad English







