For some reason, my variable(which holds multiple variables) in my Updateform can’t be set to any value whatsoever[It keeps coming up null when it is getting sent information(I did it in multiple ways, so I am 100% sure I am sending what I need)], This is weird as I previously set a string on the previous form I opened, Using the same method I used on this one.
Code:
//This is on the seriepage form
private void SeriesPageUpdate_Click(object sender, EventArgs e)
{
Update update = new Update();
update.UpdateBaseInformation = UpdateData;//Data taken from Controls in the seriepage form
update.Show();
}
//this is on the form that i am trying to set updatebaseinformation on
public partial class Update : Form
{
public DataClass UpdateBaseInformation { get; set; } //I want to set this to what i got from the other form just once
DataAccesObject accesObject = new DataAccesObject();
public Update()
{
InitializeComponent();
SeriesImage.ImageLocation = UpdateBaseInformation.C_Image;
SeriesLink.Text = UpdateBaseInformation.C_Link;
SeriesLocation.Text = UpdateBaseInformation.C_Location;
SeriesTitle.Text = UpdateBaseInformation.C_Title;
SeriesRating.Text =UpdateBaseInformation.C_Rating;
SeriesDescription.Text = UpdateBaseInformation.C_Description;
if (UpdateBaseInformation.C_Type == "Comic")
{
SeriesTypeComic.Checked = true;
}
else if (UpdateBaseInformation.C_Type == "Show")
{
SeriesTypeShow.Checked = true;
}
else if (UpdateBaseInformation.C_Type == "Book")
{
SeriesTypeBook.Checked = true;
}
else if (UpdateBaseInformation.C_Type == "Movie")
{
SeriesTypeMovie.Checked = true;
}
string[] Temporary = accesObject.SplitTagBundle(UpdateBaseInformation.C_Tags);
for (int i = 0; i < Temporary.Length; i++)
{
SeriesTag.Items.Add(Temporary[i]);
}
}
}
//And this is the code for setting a string in the seriepage form
private void Mouseclicked(object sender,EventArgs e)
{
SeriePage page = new SeriePage();
page.Title = ControlTitle;
page.Show();
}
//And this is the string getting set
public string Title { get; set; }
They are exactly the same so why is one working but not the other?
I cant find anything about this 🙁
NEWBIE is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.