Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

using System;

using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.VisualBasic;

namespace WindowsFormsApplication60
{
public partial class Form1 : Form
{
int i, j, max, min;
int[,] arr = new int[3, 3];
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
for (i = 0; i < 3; i++)
for (j = 0; j < 3; j++)
arr[i, j] = Convert.ToInt16(Interaction.InputBox("name" + i + j, "inter"));
for (i = 0; i < 3; i++)
for (j = 0; j < 3; j++)
{
listBox1.Items.Add(arr[i, j]);

1 ‫الصفحة‬ ‫ محمد حالوة‬.‫ م‬:‫اعداد‬


}
}

private void button2_Click(object sender, EventArgs e)


{
max = arr[0, 0];
for (i = 0; i < 3; i++)
{
for (j = 0; j < 3; j++)
{
if (max < arr[i, j])
max = arr[i, j];
}
} MessageBox.Show("max=" + max.ToString(),"max");
label1.Text ="max="+max.ToString();
}

private void button3_Click(object sender, EventArgs e)


{
min = arr[0, 0];
for (i = 0; i < 3; i++)
{
for (j = 0; j < 3; j++)
{
if (min > arr[i, j])
min = arr[i, j];
}
} MessageBox.Show("min=" +min.ToString(),"min");
label2.Text = "min="+min.ToString();
}

private void button4_Click(object sender, EventArgs e)


{
‫محمد تريد‬
DialogResult d = MessageBox.Show("‫حالوةهل‬ ‫اغالق‬
. ‫البرنامج م‬
‫معمع تحيات‬ ‫اغالقتحيات‬
‫البرنامج‬ ‫م‬. ‫محمد‬
‫حالوةتريد‬
‫" هل‬, "Exit calculated",
MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (d == DialogResult.Yes)
this.Close();
}
}
}

2 ‫الصفحة‬ ‫ محمد حالوة‬.‫ م‬:‫اعداد‬

You might also like