Here's the call I'm making. The ApplicationWindow property type is IWin32Window. It is coming from an application that inherits from CWinApp. The message is displayed in the upperleft corner of the screen.
RadMessageBox.Show(gtApp.ApplicationWindow, Resources.SpatialQueryNoRecords, app.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
A similar MessageBox call centers on my application just fine:
MessageBox.Show(gtApp.ApplicationWindow, Resources.SpatialQueryNoRecords, app.Name, MessageBoxButtons.OK, MessageBoxIcon.Information);
I have logged it in our feedback portal by creating a public thread on your behalf. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.
I have also updated your Telerik points.
Currently, the possible solution that I can suggest to eliminate the top left location is to manage the RadForm.Opacity property instead of the Visible property. Thus, the message is expected to be centered within the form:
this.Opacity = 0;
ApplicationWindow window = new ApplicationWindow(GetDesktopWindow());
RadMessageBox.Show(window, "Message", "Caption", MessageBoxButtons.OK, RadMessageIcon.Info);
this.Opacity = 1;
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
I have updated your sample app to try and simulate what I'm experiencing. The attached project is not exactly my scenario, but it shows the RadMessageBox displaying in the upper left corner of the screen when the IWin32Window parent parameter is not a RadForm (and when there is no RadForm displayed). The standard MessageBox displays in the middle of the DesktopWindow - the window being passed as the parent in the sample app.
In my actual scenario my application's HWND (actually a CFrameWnd's HWND) is cast to an IntPtr and passed to the ApplicationWindow's constructor. There is no RadForm displayed in my production scenario either.
Hello, Jason,
RadMessageBox is intended to be centered according to the specified parent. Otherwise, it is centered on the screen.
Following the provided information, I was unable to reproduce the issue you are facing. Please refer to the below screenshot illustrating the behavior on my end with the specified version. I have attached my sample project. Could you please specify the exact steps how to reproduce the problem? Feel free to modify it in a way to reproduce the experienced issue and get back to me with it so I can investigate the precise case. Thank you in advance.
I am looking forward to your reply.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik