Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //create a delegate
- delegate void AddToTextBoxDelegate(ref TextBox textBox1, string text);
- //create a function which the delegate will use
- private void AddToTextBox(ref TextBox textBox1, string text)
- {
- textBox1.Text += text;
- }
- //use the delegate
- name_of_your_textbox.Invoke(new AddtoTextBoxDelegate(UpdateTextBox), new object[] { ref name_of_your_textbox, string_to_write_into_your_textbox });
Add Comment
Please, Sign In to add comment