Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

170
Views
Save button to save textboxes data and listbox in another form to show the data required

I have two forms, form 1 have textboxes, radioboxes, save button to save the data required and transaction list button to open the second form. Form 2 have listbox. I want help with save button to save data of textboxes and radioboxes and then clicking transaction list button to display them on listbox in form 2.

Form1

namespace form1
{
  public partial class Form1 : Form
  {
    public Form1()
    {
        InitializeComponent();
    }

    private void label1_Click(object sender, EventArgs e)
    {

    }

    private void label2_Click(object sender, EventArgs e)
    {

    }

    private void textBox4_TextChanged(object sender, EventArgs e)
    {

    }

    private void radioButton1_CheckedChanged(object sender, EventArgs e)
    {

    }

    private void trans_Click(object sender, EventArgs e)
    {
        Form2 frm = new Form2();
        frm.ShowDialog();
    }

    private void save_Click(object sender, EventArgs e)
    {
        

    }
 }
}

Form2

namespace form1
{
  public partial class Form2 : Form
  {
    
    public Form2()
    {
        InitializeComponent();
    }

    private void label3_Click(object sender, EventArgs e)
    {

    }

    private void Form2_Load(object sender, EventArgs e)
    {

    }

    private void label1_Click(object sender, EventArgs e)
    {

    }

    private void label2_Click(object sender, EventArgs e)
    {

    }

    private void back_Click(object sender, EventArgs e)
    {
        this.Close();
        Form1 frm = new Form1();
        frm.ShowDialog();
    }

    private void textBox1_TextChanged(object sender, EventArgs e)
    {
        
    }
    private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
  }
}
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I usually add an Initialize in the second form that has parameters for each of the items you want to pass to the second form. In the trans_Click method, add a call to initialize(a,b,c,d). I would move the frm.ShowDialog(); also.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!