C#C
C#2y ago
Lutrius

To-Do List Application

Hey guys this is my script for a to do list application:

private async void rjButtonAddNew_Click(object sender, EventArgs e)
{
// Expand the panel to allow user input
panelAdd.Height = 190;
}

private void rjButtonSave_Click(object sender, EventArgs e)
{
// Create a new instance of UC_Penson
UC_Penson person = new UC_Penson();

// Assign the text from the input fields to the new UC_Penson instance
person.rjTextBoxTitle.Text = rjTextBoxTitle.Text;
person.rjTextBoxDescription.Text = rjTextBoxDescription.Text;

// Add the new UC_Penson instance to the FlowLayoutPanel (FLP)
FLP.Controls.Add(person);

// Collapse the panel after saving
panelAdd.Height = 0;

// Clear the input fields for the next entry
rjTextBoxTitle.Text = string.Empty;
rjTextBoxDescription.Text = string.Empty;
}

private void rjButtonCancel_Click(object sender, EventArgs e)
{
// Collapse the panel without saving
panelAdd.Height = 0;

// Clear the input fields
rjTextBoxTitle.Text = string.Empty;
rjTextBoxDescription.Text = string.Empty;
}

I want users to edit panelAdd then once they click save the version of panelAdd they edited appears as a new panel. Currently, users click save and only the default UC_Penson design appears without their modifications.
Was this page helpful?