D
David Veeneman
Is there a way that I can tell .NET to wait until a particular operation is
complete before passing control to the next statement?
Here's my problem: I'm working with the MonthCalendar control. When I set
its BoldedDates property, it fires the DateChanged event, which I don't want
to fire when I set that property. So I created a flag,
m_SuspendDateChangedEvent, which I set immediately before setting the
BoldedDates property, and clear immediately afterwards:
// Bold face dates with log entries
m_SuspendDateChangedEvent = true;
monthCalendar1.BoldedDates = datesWithEntries;
m_SuspendDateChangedEvent = false;
A statement at the top of the DateChanged event event handler causes an exit
if the flag is set. So far, so good.
But what is happening is that the flag is getting cleared before all of the
bold dates have been set. I'm guessing that the bolded dates are being set
asynchronously within the control. So I'm looking for a way to tell .NET to
wait until the setting of the BoldedDates property is finished before
clearing the flag.
Is that doable? Thanks in advance.
David Veeneman
Foresight Systems
complete before passing control to the next statement?
Here's my problem: I'm working with the MonthCalendar control. When I set
its BoldedDates property, it fires the DateChanged event, which I don't want
to fire when I set that property. So I created a flag,
m_SuspendDateChangedEvent, which I set immediately before setting the
BoldedDates property, and clear immediately afterwards:
// Bold face dates with log entries
m_SuspendDateChangedEvent = true;
monthCalendar1.BoldedDates = datesWithEntries;
m_SuspendDateChangedEvent = false;
A statement at the top of the DateChanged event event handler causes an exit
if the flag is set. So far, so good.
But what is happening is that the flag is getting cleared before all of the
bold dates have been set. I'm guessing that the bolded dates are being set
asynchronously within the control. So I'm looking for a way to tell .NET to
wait until the setting of the BoldedDates property is finished before
clearing the flag.
Is that doable? Thanks in advance.
David Veeneman
Foresight Systems