Hi,
I currently trying to write a component where some parts of it should run on the UI thread (explanation would be to long).
So the easiest way would be to pass a control to it, and use InvokeRequired/Invoke on it.
But I don't think that it is a good design to pass a control reference to a "data/background"-component, so I'm searching...
Dear all,
I come to you to see if someone has an idea on how to solve a problem I've come across while doing a migration to ActiveMQ.
I'm using ActiveMQ to send notifications within this project (in C#), and after finishing the implementation i found some errors concerning threading problems. (
I know that the solution for that exception...
I'm working with the DevExpress XtraGrid control.
I have a routine that goes thru and adds all the controls on the current form dynamically, and launches on a seperate thread the routine for a given control to initialize it to the value that will be displayed to the end-user. Some of the controls are displaying calculated values, and ta...
When i want to use delegate class to make call while windows form working, i always have to use InvokeRequired. It is ok. But who changed the InvokeReuqired property while it is working.
Please check this image:
...
Project is C#.
So I have a bunch of multithreaded code that is designed to be run as a library. It's in a seperate project from the UI.
My library has a central object that needs to be created before anything that would fire off events is created.
Is it possible for this master object to be passed in some objects so that my events can...
I'm building a non-visual component in .Net 2.0. This component uses an asynchronous socket (BeginReceive, EndReceive etc). Asynchronous callbacks are called in the context of a worker thread created by the runtime. The component user shouldn't have to worry about multithreading (This is the main goal, what I want)
The component user ca...
I have become painfully aware of just how often one needs to write the following code pattern in event-driven GUI code, where
private void DoGUISwitch() {
// cruisin for a bruisin' through exception city
object1.Visible = true;
object2.Visible = false;
}
becomes
private void DoGUISwitch() {
if (object1.InvokeRequir...
For example, I've got a business object Person:
class Person : INotifyPropertyChanged
{
string Name { get; set; }
DateTime DateOfBirth { get; set; }
}
// ^ abbreviated for better legibility; implementation would be trivial
And I've got some Winforms UI controls data-bound to an object of this class:
Person somePerson = ...;
n...
I had another question on my PictureBox calls giving me 3 kinds of errors, some great answers came in particularly from Conrad Frix. So it led me to figure out where my problem is, but now to fix it I am not 100% sure on.
Basically I have a Windows Form timer that is checking for some event to be true, if it is, then it tells the sys...
Lots of examples of how to invoke methods, but how does one change a simple property?
For demonstration-sake, here's a very simple set of code that should help. Let's say I need to set the visible property from a child form, and thus, it needs to be invoked:
Friend Sub activateItem(ByVal myItem As PictureBox)
If myItem.InvokeRequ...
I have had recently one of those really bad interviews, where they play good cop/bad cop with you. Whatever I replied wasn't good enough for one of them and my confidence was shrinking minute by minute. His final question that really confused me was the following:
if a control would need InvokeRequired would there be a difference in doi...