Last active
August 29, 2015 13:57
-
-
Save evonsdesigns/9521833 to your computer and use it in GitHub Desktop.
Threadsafe calls to controls in C# Winforms using parameters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delegate void updateDateTimePickerCallback(int t); | |
private void updateDateTimePicker(int t) | |
{ | |
if (dateTimePicker1.InvokeRequired) | |
{ | |
updateDateTimePickerCallback s = new updateDateTimePickerCallback(updateDateTimePicker); | |
this.Invoke(s, new object[] { t }); | |
} | |
else | |
{ | |
dateTimePicker1.Value = dateTimePicker1.Value.AddHours(t); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment