Click here to Skip to main content
16,005,241 members
Home / Discussions / C#
   

C#

 
GeneralRe: How do I make a thread safe call to a listview. Pin
cirkit131-Oct-07 4:18
cirkit131-Oct-07 4:18 
GeneralRe: How do I make a thread safe call to a listview. Pin
led mike31-Oct-07 4:54
led mike31-Oct-07 4:54 
GeneralRe: How do I make a thread safe call to a listview. Pin
ejuanpp31-Oct-07 5:07
ejuanpp31-Oct-07 5:07 
GeneralRe: How do I make a thread safe call to a listview. Pin
cirkit131-Oct-07 5:10
cirkit131-Oct-07 5:10 
GeneralRe: How do I make a thread safe call to a listview. Pin
led mike31-Oct-07 5:21
led mike31-Oct-07 5:21 
GeneralRe: How do I make a thread safe call to a listview. Pin
cirkit131-Oct-07 5:26
cirkit131-Oct-07 5:26 
GeneralRe: How do I make a thread safe call to a listview. Pin
ejuanpp31-Oct-07 5:23
ejuanpp31-Oct-07 5:23 
GeneralRe: How do I make a thread safe call to a listview. Pin
Luc Pattyn31-Oct-07 5:35
sitebuilderLuc Pattyn31-Oct-07 5:35 
Hi,


cirkit1 wrote:
I am not really changing anything in the listview.


whatever you want to do to a Control (set a property, get a property, call a method),
you must do so from the thread that created the Control in the first place.
With the exception of a few: Control.InvokeRequired, Control.Invoke(), etc.

So yes, you need the same "if InvokeRequired Invoke self" construct even to read a
ListView item.

BTW: Now you may choose to do this for each and every single Control access, or you may move
a higher-level method to the Control's thread of course, that would take more GUI time
(i.e. freeze your GUI longer), but all-in-all be better performance wise.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]


this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google


QuestionBeginner, querying random number of nodes in LinQ Pin
welldone10131-Oct-07 3:21
welldone10131-Oct-07 3:21 
AnswerRe: Beginner, querying random number of nodes in LinQ Pin
Christian Wikander31-Oct-07 4:17
Christian Wikander31-Oct-07 4:17 
GeneralRe: Beginner, querying random number of nodes in LinQ Pin
welldone10131-Oct-07 14:47
welldone10131-Oct-07 14:47 
QuestionHow do I find username of logged on user from a service Pin
dave@dmwilson.net31-Oct-07 3:08
dave@dmwilson.net31-Oct-07 3:08 
AnswerRe: How do I find username of logged on user from a service Pin
eggsovereasy31-Oct-07 9:05
eggsovereasy31-Oct-07 9:05 
GeneralRe: How do I find username of logged on user from a service Pin
dave@dmwilson.net31-Oct-07 9:13
dave@dmwilson.net31-Oct-07 9:13 
GeneralRe: How do I find username of logged on user from a service Pin
mav.northwind31-Oct-07 22:37
mav.northwind31-Oct-07 22:37 
GeneralRe: How do I find username of logged on user from a service Pin
dave@dmwilson.net1-Nov-07 2:19
dave@dmwilson.net1-Nov-07 2:19 
GeneralRe: How do I find username of logged on user from a service Pin
mav.northwind1-Nov-07 7:14
mav.northwind1-Nov-07 7:14 
QuestionExtracting images from wlan ip webcam with activeX control Pin
the_chabo31-Oct-07 3:03
the_chabo31-Oct-07 3:03 
AnswerRe: Extracting images from wlan ip webcam with activeX control Pin
Paul Conrad31-Oct-07 13:58
professionalPaul Conrad31-Oct-07 13:58 
Questionhow to 4 sql command to reduce 1 sql command Pin
eraydeniz31-Oct-07 2:53
eraydeniz31-Oct-07 2:53 
AnswerRe: how to 4 sql command to reduce 1 sql command Pin
Abhijit Jana31-Oct-07 3:08
professionalAbhijit Jana31-Oct-07 3:08 
GeneralRe: how to 4 sql command to reduce 1 sql command Pin
eraydeniz31-Oct-07 3:20
eraydeniz31-Oct-07 3:20 
GeneralRe: how to 4 sql command to reduce 1 sql command Pin
Colin Angus Mackay31-Oct-07 3:27
Colin Angus Mackay31-Oct-07 3:27 
GeneralRe: how to 4 sql command to reduce 1 sql command Pin
Frank Kerrigan31-Oct-07 3:40
Frank Kerrigan31-Oct-07 3:40 
GeneralRe: how to 4 sql command to reduce 1 sql command Pin
Paul Conrad31-Oct-07 13:59
professionalPaul Conrad31-Oct-07 13:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.