السلام عليكم
اهل لي بمساعدة منكم ؟
أنا اعمل على فيجوال استديو 2008 بلغة c#
لكني لاحظت ان اغلب الطرق والاكواد ماهي الا جافا مع اختلافات بسيطه
وطلب مني هذا البرنامج
http://www14.0zz0.com/2011/11/24/22/905812332.gif
واجهت مشكله في عمل search كيف اضع الرقم بالخانه المقابله له ومن ثم يظهر لي الاندكس تبعها بالخانه السفلى
وايضا عمل calc
بحيث يقوم باظهار جميع النتائج لي فيما سبق
ومطلوب مني عمل
handling erro & write the report of that how i solve it
والكود اللذي عملته للمطاليب السابقه هذا هو
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;
namespace WindowsFormsApplication5
{
public partial class Form1 : Form
{
double[]x;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
listBox1.Items.Add(textBox1.Text);
textBox1.Clear();
textBox1.Focus();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
if (listBox1.SelectedIndex == -1)
return;
listBox1.Items.RemoveAt(listBox1.SelectedIndex);
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)13)
button1_Click(sender, e);
}
private void button3_Click(object sender, EventArgs e)
{
int i;
x= new double[listBox1.Items.Count];
for (i = 0; i < listBox1.Items.Count; i++)
x = double.Parse(listBox1.Items.ToString());
}
private void button4_Click(object sender, EventArgs e)
{
int i;
double sum;
sum = 0;
for (i = 0; i < x.Length; i++)
sum += x;
textBox2.Text = sum.ToString();
}
private void button5_Click(object sender, EventArgs e)
{
double max;
int i;
max = x[0];
for (i = 1; i < x.Length; i++)
{
if (max < x)
max = x;
textBox3.Text = max.ToString();
}
}
private void button6_Click(object sender, EventArgs e)
{
double min;
int i;
min = x[0];
for(i=1;i<x.Length;i++)
{if (min>x)
min=x;
textBox4.Text=min.ToString();
}
}
private void button7_Click(object sender, EventArgs e)
{
double av;
int i;
av =0;
double sum;
sum = 0;
for (i = 0; i < x.Length; i++)
{ sum += x; }
av = sum / x.Length;
textBox5.Text = av.ToString();
}
private void button8_Click(object sender, EventArgs e)
{
// Calculate the average
double av;
int i;
double Diff;
av = 0;
double sum2 = 0;
double sum;
double Y;
sum = 0;
for (i = 0; i < x.Length; i++)
{ sum += x; }
av = sum / x.Length;
for (i = 0; i < x.Length; i++)
{ Diff = x - av;
double std=Math.Pow(Diff, 2);
sum2+=std;
Y = (sum2 / x.Length);
double div = Math.Sqrt(Y);
textBox6.Text = div.ToString();
}
}
private void button9_Click(object sender, EventArgs e)
{
int count = 0;
int tempcount = 0;
double result;
for (int i = 1; i < x.Length; i++)
for (int j = 0; j < x.Length - 1; j++)
{
if (x[j] != x[j + 1]) { count = 0; }
if (x[j] == x[j + 1])
{
count++;
}
if (count > tempcount)
{
tempcount = count;
result = x[j];
textBox7.Text = result.ToString();
}
}
}
private void button10_Click(object sender, EventArgs e)
{
}
private void button11_Click(object sender, EventArgs e)
{
int i,j;
double t;
for (i=0;i<=x.Length-1;i++)
{
for(j=i+1;j<=x.Length-1;j++)
{if (x>x[j])
{
t = x;
x=x[j];
x[j]=t;
}
}
}
for (i = 0; i <= x.Length - 1; i++)
listBox2.Items.Add(x);
}
}
}هل يستطيع أحد مساعدتي ولكم جزيل الشكر