This is a migrated thread and some comments may be shown as answers.

Show from background thread

4 Answers 327 Views
DesktopAlert
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 20 Jun 2011, 01:36 PM
I have a thread that connects to a service. All is well there. I am able to show MessageBox and forms from it.

The problem occurs when I try to plug in the desktopalert to show a message instead of using a form or MessageBox.  I get a black box down next to my task manager and if I click it I get an non response message fom windows.

How can I show an alert from a thread which isn't the main thread? I do not want to use backgroundworker and my component doesn't have Invoke() available.

Thank you.

4 Answers, 1 is accepted

Sort by
0
Boryana
Telerik team
answered on 23 Jun 2011, 12:24 PM
Hello Chris,

Thank you for contacting us.

Our controls, including RadDesktopAlert, must be shown in the primary UI thread. You will be able to implement your scenario with standard MS controls, such as Forms and MessageBoxes, since they do not share static instances, such as themes.

I hope you find this information useful. Let me know if you have further questions.

Kind regards,
Boryana
the Telerik team

Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.

0
Will
Top achievements
Rank 1
answered on 15 May 2013, 05:07 PM
Does this thread answer your question?
0
Reza
Top achievements
Rank 1
answered on 07 Dec 2019, 04:31 PM

hi

i have a thread outside of UI(main) thread, and i want show radDesktopAlert on it, but radAlert not show

new MethodInvoker(new Action(() =>
{
    radAlert.Show();
})).Invoke();

can you help me about it?

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 10 Dec 2019, 01:08 PM | edited on 12 Jan 2023, 11:45 AM
Hello, Reza, 

I have prepared a sample project for your reference demonstrating how to show a RadDesktopAlert from another thread. The key part is using a MethodInvoker to protect your code from cross-thread operations and show the alerts in the UI thread rather than the background one.

Please give the attached application a try and see how it works on your end.

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
DesktopAlert
Asked by
Mark
Top achievements
Rank 1
Answers by
Boryana
Telerik team
Will
Top achievements
Rank 1
Reza
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or