Jump to content

Thread stopping

- - - - -

  • Please log in to reply
No replies to this topic

#1
JARAFG

JARAFG

    Newbie

  • Members
  • Pip
  • 2 posts
Hey!

I have a problem.. I have this code:

        private delegate void UpdateColumnDelegate(object sender, int cid = 0, int status = 0);


        public void UpdateColumn(object sender, int cid = 0, int status = 0)

        {

            if (this.InvokeRequired)

            {

                this.Invoke(new UpdateColumnDelegate(UpdateColumn), new object[] { cid, status });

            }


            if (status == 0)

            {

                var res = "Failed";

                listView1.Items[cid].SubItems.Add(res);


            }

            else if (status == 1)

            {

                var res = "Successful";

                listView1.Items[cid].SubItems.Add(res);

            }

        }

And somehow when I run it it doesn't work.. it doesn't update listview and when all items are done.. program just hangs.. So please help me out, what I'm doing wrong.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users