Öncelikle iyi akşamlar şimdiden imla hatalarım olursa affola. C# form uygulamasında veritabansız basit bir soru cevap projesi yapmaktayım. Genel hatlarıyla anlatmak gerekirse 10 soru var ve 10 adet picturebox mevcut. toplamda 10 form sayfası var buton aracılığıyla diğer soruya geçiş sağlıyor. Benim amacım her yanlış cevapta bir resim kutusu silinıcek buraya kadar yapabildim. Sorun şurada başlıyor form1 den form2 e veriyi taşıyorum fakat form3 4 5... silinen picturebox1 i görmüyor veya 2. soruda yanlış yapınca picturebox2 görmeyip gizlemiyor bir form sayfasında yanlış yapıldığı zaman diğer form sayfalarında da onu hafızada tutturmayı nasıl yapabilirim yardımcı olabilirseniz çok memnun olurum.
kodlar bu şekilde diğer formlar içinde benzer kodlar sadece değişken adları farklı.
C#:
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;
namespace ProjeA
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
button2.Visible = false;
}
public **** ResimDegistir(Image resim)
{
pictureBox1.Image = resim;
}
private **** button1_Click(object sender, EventArgs e)
{
string sorubir;
sorubir = textBox1.Text;
textBox1.Text = ("");
if (sorubir == "a")
{
label3.Text =("Basitti farkındayım );
textBox1.Enabled = false;
button1.Visible = false;
button2.Visible = true;
}
else if (sorubir == "")
{
MessageBox.Show("Boş yapıyorsun yapma");
}
else
{
MessageBox.Show("nasıl bilemessin");
pictureBox1.Image = null;
textBox1.Enabled = false;
button1.Visible = false;
button2.Visible = true;
}
}
private **** button2_Click(object sender, EventArgs e)
{
Form3 Form3 = new Form3();
Form3.ResimDegistir(pictureBox1.Image);
Form3.Show();
this.Hide();
}
}
}
kodlar bu şekilde diğer formlar içinde benzer kodlar sadece değişken adları farklı.