InfoBox.NotifyBoxSettings - How to use it correctly


Author
Message
Marcelo Blank
Marcelo Blank
StrataFrame Novice (82 reputation)StrataFrame Novice (82 reputation)StrataFrame Novice (82 reputation)StrataFrame Novice (82 reputation)StrataFrame Novice (82 reputation)StrataFrame Novice (82 reputation)StrataFrame Novice (82 reputation)StrataFrame Novice (82 reputation)StrataFrame Novice (82 reputation)
Group: StrataFrame Users
Posts: 0, Visits: 414
Hi..

I Have a InfoBox.NotifyBoxSettings, that I call in another thread of the app.

It is a stock trade screen, full of settings during all the time, with a lot of combos and other components ...

The problem is that when the InfoBox.NotifyBoxSettings appers, and I ´m editing or with a combo open (selecting a broker...) it closes it and get the value of the combo, that was in a selection process...

How can I avoid this behavior ?

Regards,
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hi Marcelo.

Don't know how you coded the other thread and maybe a sample application would help. But have you tried using a BackgroundWorker to show your InfoBox on its ProgressChanged event?
StrataFrame Team
S
StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
You would need to use a System.Threading.ManualResetEvent to prevent the other thread from showing the InfoBox.  Both threads would need a reference to it, so put it somewhere (static field or something) where they can both see it.  Create it with True in the constructor so it starts already signaled; that way, if you never open the combo box, the InfoBox isn't blocked.  Then, in the DropDownOpened (or whatever the event is, I can't remember), call .Reset() on the ManualResetEvent, and when the drop down closes or when you're ready to allow the InfoBox to show, call .Set() on it.  Lastly, in the thread that shows the InfoBox, call .WaitOne() on the ManualResetEvent right before the InfoBox is shown.  This will cause that other thread to block until the combo box closes and you call .Set() on the main thread.
Marcelo Blank
Marcelo Blank
StrataFrame Novice (82 reputation)StrataFrame Novice (82 reputation)StrataFrame Novice (82 reputation)StrataFrame Novice (82 reputation)StrataFrame Novice (82 reputation)StrataFrame Novice (82 reputation)StrataFrame Novice (82 reputation)StrataFrame Novice (82 reputation)StrataFrame Novice (82 reputation)
Group: StrataFrame Users
Posts: 0, Visits: 414
Thank you for a roadmap ...

I will try it.

Regards,
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search