| | |
Complete task THEN continue
Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: May 2008
Posts: 99
Reputation:
Solved Threads: 1
I need need it to update my ListView before continueing
UpdateListView()
Atm it updates it once the thread has finished its business but i need the check to either run on another thread or the update to finish before it continues
C# Syntax (Toggle Plain Text)
if (chars.Length > 0) { string log = string.Format("{0}:{1}", acc.Username, acc.Password); UpdateListView(); sWorking += log + "\r\n"; foreach (IJJIAccount.GunZCharacter gc in chars) { log = string.Format("\t{0} - Level {1}", gc.CharName, gc.Level); sWorking += log + "\r\n"; } }
UpdateListView()
C# Syntax (Toggle Plain Text)
void UpdateListView() { ListViewItem Lvi = new ListViewItem(acc.Username); ListViewItem.ListViewSubItem LviPassword = new ListViewItem.ListViewSubItem(Lvi, acc.Password); Lvi.SubItems.Add(LviPassword); IDC_ListView.Items.Add(Lvi); }
Atm it updates it once the thread has finished its business but i need the check to either run on another thread or the update to finish before it continues
Yo dude, maybe something like this will work , it works for me ...
C# Syntax (Toggle Plain Text)
Application.DoEvents(); listView1.Refresh();
Last edited by cVz; Jan 9th, 2009 at 2:14 am.
Delphi & C# programmer deluxe...
•
•
Join Date: Aug 2008
Posts: 1,735
Reputation:
Solved Threads: 186
If you just want to update, calling application.DoEvents can have bad reactions and cause odd things, so, you can just run .Update() which causes a repaint but doesnt cause new bits of code to run
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
![]() |
Similar Threads
- "if" suggestions (JavaScript / DHTML / AJAX)
- 100% CPU usage & hardware interrupts.......2 (Viruses, Spyware and other Nasties)
- algorithm problem with recursion (Java)
- I've got Trojan.Holax... is this bad? (Viruses, Spyware and other Nasties)
- not-a-virusadware (Viruses, Spyware and other Nasties)
- IE Will Not Open Anymore (Viruses, Spyware and other Nasties)
- rundll32.exe problem on shutdown (Viruses, Spyware and other Nasties)
- Can't trash this file (OS X)
Other Threads in the C# Forum
- Previous Thread: Null reference in array
- Next Thread: Cutting strings
| Thread Tools | Search this Thread |
.net access ado.net algorithm array barchart basic bitmap box broadcast buttons c# check checkbox client combobox contorl control conversion csharp custom database datagrid datagridview dataset datetime degrees deployment development disabled displayingopenforms draganddrop drawing editing editor encryption enum event excel file form format forms function gdi+ httpwebrequest i18n image imageprocessing index input install java label list listbox mandelbrot math mathematics mouseclick mysql operator oracle path photoshop picturebox pixelinversion post prime programming radians regex remote remoting richtextbox rows server setup sleep socket sql statistics stream string table text textbox thread time timer update user usercontrol validation visualstudio webbrowser windows winforms wpf xml






