I need to create a software that manages a bank account.
I created 2 forms.
Form one (Form1 "in reality is KlientetForm") has 5 textboxes, 6 buttons and a listbox.
Form twoo (Form2 "in reality is GjendjaForm") has 3 textboxes (the same name as in Form1), 2 listboxes and 3 buttons.
I created the program that it can save the data in text file.
I can read the data from Form1 and show the details in listbox.
When i select a row in a listbox the items are shown in textboxes.
My question is how to show the content of a row if I select it from Form1 in textboxes in Form2.
Here are some code I made to show the details in Form1.
private void ListBox_SelectedIndexChanged(object sender, EventArgs e)
{
this.ShtoButon.Enabled = false;
this.AzhuroButon.Enabled = true;
this.FshijButon.Enabled = true;
this.AktivButon.Enabled = true;
this.JoaktivButon.Enabled = true;
this.GjendjaButon.Enabled = true;
try
{
string linjaListBox = this.ListBox.SelectedItem.ToString();
string emriPjesa = linjaListBox.Split('\t')[0];
string mbiemriPjesa = linjaListBox.Split('\t')[1];
string datelindjaPjesa = linjaListBox.Split('\t')[2];
string vendlindjaPjesa = linjaListBox.Split('\t')[3];
string xhirollogariaPjesa = linjaListBox.Split('\t')[4];
this.emriBox.Text = emriPjesa;
this.mbiemriBox.Text = mbiemriPjesa;
this.datelindjaBox.Text = datelindjaPjesa;
this.vendlindjaBox.Text = vendlindjaPjesa;
this.xhirollogariaBox.Text = xhirollogariaPjesa;
indeksLista = Convert.ToInt32(ListBox.SelectedIndex.ToString());
}
catch
{ }
}
The Form2 begins with following:
namespace LlogariaBankare
{
public partial class GjendjaForm : Form
}
I'm trying to fix the problem with GjendjaForm.emriBox.Text = emriPjesa;
but i can not fix the problem because: it is inaccessible due to its protection level.
Thank you in advance for your reply.