passing information
-
i am passing information from listbox to another listbox in a different form by just pass using system this is the code i'm passing with string[] items = new string[lstSelectedItems.Items.Count]; amoun = txtAmount.Text; lstSelectedItems.Items.CopyTo(items, 0); FrmOrderDetails order = new FrmOrderDetails(txtAmount.Text,items); order.Show(); this is the code in a form that i want to accept the data am passing string it; private string totalprice; public string Totalprice { get { return totalprice; } set { totalprice = value; } } public FrmOrderDetails(string tprice, string[] items) { InitializeComponent(); it = items.ToString(); tprice = Totalprice; private void FrmOrderDetails_Load(object sender, EventArgs e) { totalprice = txtTotalPrice.Text; lstOrderDetails.Items.Add(it); }
-
i am passing information from listbox to another listbox in a different form by just pass using system this is the code i'm passing with string[] items = new string[lstSelectedItems.Items.Count]; amoun = txtAmount.Text; lstSelectedItems.Items.CopyTo(items, 0); FrmOrderDetails order = new FrmOrderDetails(txtAmount.Text,items); order.Show(); this is the code in a form that i want to accept the data am passing string it; private string totalprice; public string Totalprice { get { return totalprice; } set { totalprice = value; } } public FrmOrderDetails(string tprice, string[] items) { InitializeComponent(); it = items.ToString(); tprice = Totalprice; private void FrmOrderDetails_Load(object sender, EventArgs e) { totalprice = txtTotalPrice.Text; lstOrderDetails.Items.Add(it); }
And your question is?
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.” Why do programmers often confuse Halloween and Christmas? Because 31 Oct = 25 Dec.
-
And your question is?
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.” Why do programmers often confuse Halloween and Christmas? Because 31 Oct = 25 Dec.
-
The problem in your code is this
it = items.ToString();
line.
items.ToString()
will give "System.String[]" (in other words a description of theType
you are using not its contents). Not what you want, I suspect. Investigate theString.Join()
method for one possible solution.Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.” Why do programmers often confuse Halloween and Christmas? Because 31 Oct = 25 Dec.
-
And your question is?
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.” Why do programmers often confuse Halloween and Christmas? Because 31 Oct = 25 Dec.
nowhere to be seen. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
-
i am passing information from listbox to another listbox in a different form by just pass using system this is the code i'm passing with string[] items = new string[lstSelectedItems.Items.Count]; amoun = txtAmount.Text; lstSelectedItems.Items.CopyTo(items, 0); FrmOrderDetails order = new FrmOrderDetails(txtAmount.Text,items); order.Show(); this is the code in a form that i want to accept the data am passing string it; private string totalprice; public string Totalprice { get { return totalprice; } set { totalprice = value; } } public FrmOrderDetails(string tprice, string[] items) { InitializeComponent(); it = items.ToString(); tprice = Totalprice; private void FrmOrderDetails_Load(object sender, EventArgs e) { totalprice = txtTotalPrice.Text; lstOrderDetails.Items.Add(it); }
ask a proper question and/or give precise symptoms, and please use PRE tags to show code snippets. Maybe what you need is similar to
lb2.Items.Add(lb1.SelectedItems);
:)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).