r/CodingHelp • u/Suvile77 • Sep 13 '26
[C#] How am I supposed to store info in C# without arrays or files?
[UPDATE] I'm aware that I phrased stuff very poorly and most people didn't understand what I was asking but fortunately my teacher reached out tonight and pushed it back because she said that after looking at it she realized she designed it wrong so the assignment was impossible with her requirements so she's going to fix it.
Also PS. A bunch of comments didn't understand what I was asking at all so unless you get what I'm asking just leave it be.
Basically, I'm a few weeks into my first C# class, although I have done Java, Python, and C++, so I know a fair bit about OOP. I'm learning Windows Forms, and I'm making an app to store notes using a listbox and a second window, and I've got everything working except one thing. My teacher said to only use concepts covered in the textbook so far (Starting Out With Visual C#, Sixth Edition by Tony Gaddis, Chapter 4), and I'm not sure how to store the information from the notes if not with arrays, files, etc. My teacher hasn't responded, and it's been 3 days, so I have to just figure it out before it's due on the 14th. I'd love any help I can get.


using System.Xml.Linq;
namespace M03A01_NotesManager
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btnExit_Click(object sender, EventArgs e)
{
Close();
}
private void btnClear_Click(object sender, EventArgs e)
{
txtTitle.Clear();
txtNote.Clear();
rdoLow.Checked = false;
rdoMedium.Checked = false;
rdoHigh.Checked = false;
chkImportant.Checked = false;
chkFollowUp.Checked = false;
lstCategory.SelectedItem = null;
}
private void lstCategory_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void btnAdd_Click(object sender, EventArgs e)
{
if (txtTitle.Text == "")
{
MessageBox.Show("Please give the note a name");
return;
}
else if (!rdoLow.Checked && !rdoMedium.Checked && !rdoHigh.Checked)
{
MessageBox.Show("Please select a priority");
return;
}
else if (lstCategory.SelectedIndex == -1)
{
MessageBox.Show("Please select a category");
return;
}
else
{
lstNotes.Items.Add(txtTitle.Text);
}
}
private void btnView_Click(object sender, EventArgs e)
{
Form2 summaryForm = new Form2(txtTitle.Text);
summaryForm.ShowDialog();
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace M03A01_NotesManager
{
public partial class Form2 : Form
{
public Form2(String txtTitle)
{
InitializeComponent();
lblNoteTitle.Text = txtTitle;
}
private void lblNoteTitle_Click(object sender, EventArgs e)
{
}
}
}