Arkadaşlar merhaba,
c# üstteki sorunu çözdüm ancak bir yerde takıldım. Yardımcı olabilir misiniz acaba..
using System;
using System.Collections.Generic;
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void pictureBox1_Click(object sender, EventArgs e)
{
}
private void tabPage1_Click(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
string[] Donem_1 = { "Matematik", "Fizik", "İngilizce", "Programlama" };
string[] Donem_2 = { "Türk Dili", "Kimya", "Veri Tabanı", "İnternet Programcılığı" };
string[] Kod_1 = { "MAT101", "FIZ101", "DIL101", "PRG101" };
string[] Kod_2 = { "TUR102", "KIM102", "VTB102", "INP102" };
byte[] AKTS_1 = { 3, 3, 2, 4 };
byte[] AKTS_2 = { 2, 2, 4, 5 };
textBox7.Text = Donem_1[0];
textBox8.Text = Donem_1[1];
textBox9.Text = Donem_1[2];
textBox10.Text = Donem_1[3];
textBox39.Text = Donem_2[0];
textBox38.Text = Donem_2[1];
textBox37.Text = Donem_2[2];
textBox36.Text = Donem_2[3];
textBox3.Text = Kod_1[0];
textBox4.Text = Kod_1[1];
textBox5.Text = Kod_1[2];
textBox6.Text = Kod_1[3];
textBox43.Text = Kod_2[0];
textBox42.Text = Kod_2[1];
textBox41.Text = Kod_2[2];
textBox40.Text = Kod_2[3];
textBox11.Text = AKTS_1[0].ToString();
textBox12.Text = AKTS_1[1].ToString();
textBox13.Text = AKTS_1[2].ToString();
textBox14.Text = AKTS_1[3].ToString();
textBox35.Text = AKTS_2[0].ToString();
textBox34.Text = AKTS_2[1].ToString();
textBox33.Text = AKTS_2[2].ToString();
textBox32.Text = AKTS_2[3].ToString();
}
private float Katsayi(string Notu)
{
if (Notu == "AA")
{
return 4;
}
else if (Notu == "BA")
{
return 3.5f;
}
else if (Notu == "BB")
{
return 3;
}
else if (Notu == "CB")
{
return 2.5f;
}
else if (Notu == "CC")
{
return 2;
}
else if (Notu == "DC")
{
return 1.5f;
}
else if (Notu == "DD")
{
return 1;
}
else
return 0;
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void label3_Click(object sender, EventArgs e)
{
}
private void tableLayoutPanel1_Paint(object sender, PaintEventArgs e)
{
}
private void label7_Click(object sender, EventArgs e)
{
}
private void label7_Click_1(object sender, EventArgs e)
{
}
private void textBox7_TextChanged(object sender, EventArgs e)
{
}
private void textBox15_TextChanged(object sender, EventArgs e)
{
}
private void textBox19_TextChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
int toplam = Convert.ToInt32(textBox11.Text) + Convert.ToInt32(textBox12.Text) + Convert.ToInt32(textBox13.Text) + Convert.ToInt32(textBox14.Text);
textBox19.Text = toplam.ToString();
}
private void button2_Click(object sender, EventArgs e)
{
if (textBox25.Text == string.Empty)
{
MessageBox.Show("Öncelikle 1. ve 2. yarıyıl ortalamalarını hesaplayınız. ", "UYARI", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
else if (textBox26.Text == string.Empty)
{
MessageBox.Show("Öncelikle 1. ve 2. yarıyıl ortalamalarını hesaplayınız. ", "UYARI", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
int toplam2 = Convert.ToInt32(textBox32.Text) + Convert.ToInt32(textBox33.Text) + Convert.ToInt32(textBox34.Text) + Convert.ToInt32(textBox35.Text);
textBox20.Text = toplam2.ToString();
}
private void button3_Click(object sender, EventArgs e)
{
int toplam3 = Convert.ToInt32(textBox32.Text) + Convert.ToInt32(textBox33.Text) + Convert.ToInt32(textBox34.Text) + Convert.ToInt32(textBox35.Text) + Convert.ToInt32(textBox11.Text) + Convert.ToInt32(textBox12.Text) + Convert.ToInt32(textBox13.Text) + Convert.ToInt32(textBox14.Text);
textBox21.Text = toplam3.ToString();
}
private void textBox21_TextChanged(object sender, EventArgs e)
{
}
}
}Benim burada yapmak istediğim Textbox a harf bazında girilen sayıyı rakama dönüştürüp başka bir textboxtaki değer ile çarpmak.
Mesela AA diye giriş yapan birinin notu 4 e çevrilip başka bir textbox ile çarpılacak.
Ama notlar harf olarak girildiği için sanırım convert işlemini yapamıyorum.
Yardımcı olabilirseniz çok sevinirim.
Şimdiden teşekkürler.