Click here to Skip to main content
14,847,125 members
Home / Discussions / C#
   

C#

 
AnswerRe: Does anyone know the C# implementation for this? Pin
Luc Pattyn12-Feb-21 3:37
sitebuilderLuc Pattyn12-Feb-21 3:37 
AnswerRe: Does anyone know the C# implementation for this? Pin
Gerry Schmitz12-Feb-21 9:21
mveGerry Schmitz12-Feb-21 9:21 
QuestionHow to access GUI from another thread? Pin
Alex Dunlop11-Feb-21 7:10
MemberAlex Dunlop11-Feb-21 7:10 
AnswerRe: How to access GUI from another thread? Pin
Gerry Schmitz11-Feb-21 7:39
mveGerry Schmitz11-Feb-21 7:39 
GeneralRe: How to access GUI from another thread? Pin
Alex Dunlop11-Feb-21 7:40
MemberAlex Dunlop11-Feb-21 7:40 
GeneralRe: How to access GUI from another thread? Pin
Alex Dunlop11-Feb-21 8:07
MemberAlex Dunlop11-Feb-21 8:07 
GeneralRe: How to access GUI from another thread? Pin
Dave Kreskowiak11-Feb-21 13:17
mveDave Kreskowiak11-Feb-21 13:17 
AnswerRe: How to access GUI from another thread? Pin
Gerry Schmitz11-Feb-21 9:03
mveGerry Schmitz11-Feb-21 9:03 
1) Add reference to WindowsBase.dll

2) Add: using System.Windows.Threading;

3) Add delegate declaration OUTSIDE of method:
delegate void ProgressDelegate( int pct );

4) Replace (in this case):
backgroundWorker1.ReportProgress(i);

with:
ProgressDelegate progressDelegate = delegate ( int pct ) { this.progressBar1.Value = pct; };

System.Windows.Threading.Dispatcher.CurrentDispatcher.BeginInvoke(
   DispatcherPriority.Normal, progressDelegate, percentComplete );

Then it's just a matter of tailoring for various UI controls.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food

AnswerRe: How to access GUI from another thread? Pin
Ralf Meier11-Feb-21 10:36
professionalRalf Meier11-Feb-21 10:36 
AnswerRe: How to access GUI from another thread? PinPopular
Luc Pattyn11-Feb-21 11:29
sitebuilderLuc Pattyn11-Feb-21 11:29 
GeneralRe: How to access GUI from another thread? Pin
Eddy Vluggen11-Feb-21 14:01
professionalEddy Vluggen11-Feb-21 14:01 
GeneralRe: How to access GUI from another thread? Pin
Alex Dunlop11-Feb-21 18:18
MemberAlex Dunlop11-Feb-21 18:18 
GeneralRe: How to access GUI from another thread? Pin
Alex Dunlop11-Feb-21 19:39
MemberAlex Dunlop11-Feb-21 19:39 
GeneralRe: How to access GUI from another thread? Pin
Alex Dunlop11-Feb-21 18:16
MemberAlex Dunlop11-Feb-21 18:16 
QuestionJsonConvert.DeserializeObject Pin
Member 1449252210-Feb-21 21:43
MemberMember 1449252210-Feb-21 21:43 
AnswerRe: JsonConvert.DeserializeObject Pin
OriginalGriff10-Feb-21 22:05
mveOriginalGriff10-Feb-21 22:05 
AnswerRe: JsonConvert.DeserializeObject Pin
Member 1449252211-Feb-21 4:13
MemberMember 1449252211-Feb-21 4:13 
AnswerRe: JsonConvert.DeserializeObject Pin
James Curran11-Feb-21 23:58
MemberJames Curran11-Feb-21 23:58 
GeneralRe: JsonConvert.DeserializeObject Pin
Member 1449252212-Feb-21 7:08
MemberMember 1449252212-Feb-21 7:08 
QuestionBackGroundWorker gives runtime error Pin
Alex Dunlop10-Feb-21 4:13
MemberAlex Dunlop10-Feb-21 4:13 
AnswerRe: BackGroundWorker gives runtime error Pin
OriginalGriff10-Feb-21 4:36
mveOriginalGriff10-Feb-21 4:36 
GeneralRe: BackGroundWorker gives runtime error Pin
Alex Dunlop10-Feb-21 4:44
MemberAlex Dunlop10-Feb-21 4:44 
GeneralRe: BackGroundWorker gives runtime error Pin
OriginalGriff10-Feb-21 5:00
mveOriginalGriff10-Feb-21 5:00 
GeneralRe: BackGroundWorker gives runtime error Pin
Alex Dunlop10-Feb-21 5:03
MemberAlex Dunlop10-Feb-21 5:03 
GeneralRe: BackGroundWorker gives runtime error Pin
OriginalGriff10-Feb-21 5:43
mveOriginalGriff10-Feb-21 5:43 

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.