PDA

Tam Sürümünü Görmek İçin : Projemle ilgili bir soru


devlev
16/05/2008, 17:06
At butonu ile textboxda atılmış olan parayı arttırıyorum ama sol tarftan bir ürün seçip ürünü ver dedirttiğide sadece birkez fiyat düşüyor. sonrasında 25 25 artıyor. nasıl çözebilirim bu sorunu


http://img230.imageshack.us/img230/253/yolllllllllap9.jpg

private: System::Void button3_Click_1(System::Object^ sender, System::EventArgs^ e) {


if (radioButton1->Checked)
toplam +=5;
textBox1->Text=toplam.ToString();

if (radioButton2->Checked)
toplam = (toplam+10);
textBox1->Text=toplam.ToString();

if (radioButton3->Checked)
toplam +=25;
textBox1->Text=toplam.ToString();


if (radioButton4->Checked)
toplam +=50;
textBox1->Text=toplam.ToString();

if (radioButton5->Checked)
toplam +=100;
textBox1->Text=toplam.ToString();








}




private: System::Void button1_Click_1(System::Object^ sender, System::EventArgs^ e) {


////////////// 25 YKr

int x;
if (((radioButton6->Checked)|| (radioButton9->Checked)|| (radioButton12->Checked)||
(radioButton13->Checked)|| (radioButton14->Checked)|| (radioButton20->Checked)||
(radioButton21->Checked))&& (toplam>=25)){
pictureBox1->Image=ımageList1->Images[0];


x=toplam-25;
//textBox1->Text=x.ToString();

}
//////////50 YKr
else if ( ((radioButton7->Checked)||
(radioButton8->Checked)||
(radioButton10->Checked)||
(radioButton15->Checked)||
(radioButton17->Checked)||
(radioButton18->Checked))&& (toplam>=50)){
pictureBox1->Image=ımageList1->Images[1];

x=toplam-50;
//textBox1->Text=x.ToString();}

////////////75 YKr
else if (
((radioButton11->Checked)||
(radioButton16->Checked)||
(radioButton19->Checked))
&& (toplam>=75)){
pictureBox1->Image=ımageList1->Images[2];
x=toplam-75;
//textBox1->Text=x.ToString();

}


sekizbit
16/05/2008, 19:13
Yukardaki kod`da toplam parayi, toplam degiskeninde tutuyorsun, assagidaki kodda toplam degiskenini hic guncellemiyorsun. surekli x= toplam -75 gibi islemler yapmissin, en sonunda toplam = x yapmayi dene.

Ayrica bu sorunun yeri C# bolumu olmaliydi.

devlev
17/05/2008, 12:57
visual c++ ile tasarlıyorum projemi o yüzden buraya yazdım. cevabın için teşekkür ederim deniyorum şmdi...

devlev
17/05/2008, 14:49
gene kendi bildiklerini okuyorlar :(

hem global hem local değişen olarak denedim ama olmadı. acaba if lerdemi sorun var ben göremiyorum...

hgedek
17/05/2008, 21:40
Herhangi bir hata görünmüyor.Button1_click fonksiyonunun en sonunda toplam=x demen bu sorunu çözmeli aslında.
Ayrıca 50 ykr kısmında { kapatmamışsın sanırım.

hgedek
17/05/2008, 22:01
kullandığın herhangi bir kaynak falan varsa visual c++ hakkında (tutorial falan da olur) isim yada adres verirsen sevinirim.

devlev
17/05/2008, 23:39
yok maalsef googlede aratıp rastgele sayfalardan biraz çözmeye çalıştım ama olmadı gibi :)
gene yaptım olmadı. dediğn gbi "{" diğer kısımlardada kapanmamış birer tane kapattım bir umut ama gene yemedi

yardımların için teşekkür ederim

devlev
21/05/2008, 22:07
global olarak bakiye değişkenini tanımladım. bu şekilde sorunu çözdüm



private: System::Void button1_Click_1(System::Object^ sender, System::EventArgs^ e) {


////////////// 25 YKr


if (((radioButton6->Checked)|| (radioButton9->Checked)|| (radioButton12->Checked)||
(radioButton13->Checked)|| (radioButton14->Checked)|| (radioButton20->Checked)||
(radioButton21->Checked))&& (toplam>=25))

{
pictureBox1->Image=ımageList1->Images[0];
bakiye=toplam-25;
toplam=bakiye;
textBox1->Text=bakiye.ToString()+ " YKr";

}
//////////50 YKr
if ( ((radioButton7->Checked)||
(radioButton8->Checked)||
(radioButton10->Checked)||
(radioButton15->Checked)||
(radioButton17->Checked)||
(radioButton18->Checked))&& (toplam>=50))

{
pictureBox1->Image=ımageList1->Images[1];
bakiye=toplam-50;
toplam=bakiye;
textBox1->Text=bakiye.ToString()+ " YKr";

}

////////////75 YKr


if (
((radioButton11->Checked)||
(radioButton16->Checked)||
(radioButton19->Checked))
&& (toplam>=75))

{

pictureBox1->Image=ımageList1->Images[2];
bakiye=toplam-75;
toplam=bakiye;
textBox1->Text=bakiye.ToString()+ " YKr";

}



}