I have an application which has multiple controls on multiple pages. I'm using the Telerik Winforms controls. One of those pages has a RadGridView
in a UserControl
, which is on a RadPageViewPage
in a RadPageView
, which in turn is nested in another RadPageViewPage
in another RadPageView
. The following code is basically just to handle a Loading spinner that is housed in its own transparent Form. It is always called on its own thread, of course.
private static void RunWaiting(Control c, string text)
{
wf = new WaitingForm();
wf.drwbieSpinnerFrame.Text = text;
wf.ShowInTaskbar = false;
wf.Left = c.Left + (c.Width / 2);
wf.Top = c.Top + (c.Height / 2);
wf.Width = c.Width;
wf.Height = c.Height;
wf.FormBorderStyle = FormBorderStyle.None;
wf.ControlBox = false;
wf.TopMost = true;
wf.StartPosition = FormStartPosition.Manual;
Application.Run(wf);
}
Clearly, I want the spinner (WaitForm
) to appear over the center of a control on-demand. It's fine if I pass it the main UserControl
that houses the RadGridView
, and I can also pass it the parent of that control and center on the RadPageViewPage
. If I pass this method the RadGridView
, the spinner doesn't appear at all, even though the code is called and the attributes of "wf
" are still set. Can anyone tell me what I'm missing?