Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. passing information

passing information

Scheduled Pinned Locked Moved .NET (Core and Framework)
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kolisa
    wrote on last edited by
    #1

    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); }

    H L 2 Replies Last reply
    0
    • K kolisa

      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); }

      H Offline
      H Offline
      Henry Minute
      wrote on last edited by
      #2

      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.

      K L 2 Replies Last reply
      0
      • H Henry Minute

        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.

        K Offline
        K Offline
        kolisa
        wrote on last edited by
        #3

        doesnt pass valid data

        H 1 Reply Last reply
        0
        • K kolisa

          doesnt pass valid data

          H Offline
          H Offline
          Henry Minute
          wrote on last edited by
          #4

          The problem in your code is this

          it = items.ToString();

          line. items.ToString() will give "System.String[]" (in other words a description of the Type you are using not its contents). Not what you want, I suspect. Investigate the String.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.

          1 Reply Last reply
          0
          • H Henry Minute

            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.

            L Offline
            L Offline
            Luc Pattyn
            wrote on last edited by
            #5

            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).


            1 Reply Last reply
            0
            • K kolisa

              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); }

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #6

              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).


              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups