Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
C#
I am using slideUI controls in my project . There is a spinner control which is used as wait cursor. I want to display the spinner when I load data in a List. But when I try to display the spinner it visualize as an image not a rotating image.

Below is my code.

private void uiButton_Click(object sender, EventArgs e)
    {
        ShowFrame(this.uiPanel1);

        Application.DoEvents();

        LoadList();

        HideFrame(uiPanel1);

    }

    private void LoadList()
    {
        try
        {
            //Call the BeginAddControls before starting manipulations with UIList 
            uiList1.BeginAddControls();

            for (int i = 0; i < 100; i++)
            {
                UIListItem item = new UIListItem();
                item.Text = "Primary Text" + i;
                item.SecondaryText = "This is secondary text..";
                item.ItemStyle = UIListItemStyle.SingleText;
                item.Height = Utils.CalcScaleSize(38);
                item.BackColor = System.Drawing.SystemColors.Window;
                item.BackEndColorSelected = System.Drawing.SystemColors.Highlight;
                item.BackStartColorSelected = System.Drawing.SystemColors.Highlight;
                item.BottomBorderColor = System.Drawing.Color.Gainsboro;
                item.Buffering = true;
                item.ColorScheme = SlideUI.UIColorSchemesCustom.Orange;
                item.Dock = System.Windows.Forms.DockStyle.Top;
                item.GroupArrowColor = System.Drawing.Color.Gray;
                item.GroupArrowColorSelected = System.Drawing.Color.White;
                item.IconQVGA = null;
                item.IconSize = new System.Drawing.Size(25, 31);
                item.IconTransparent = false;
                item.IconTransparentColor = System.Drawing.Color.Transparent;
                item.IconVGA = null;
                item.IconVisible = true;
                item.InheritParentSettings = true;
                item.IsGroup = false;
                item.IsSelected = false;
                item.SecondaryTextColor = System.Drawing.SystemColors.GrayText;
                item.SecondaryTextColorSelected = System.Drawing.SystemColors.HighlightText;
                item.SecondaryTextFont = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular);
                item.TextColor = System.Drawing.SystemColors.WindowText;
                item.TextColorSelected = System.Drawing.SystemColors.HighlightText;
                item.TextFont = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
                item.UseGradient = true;
                item.VirtualBufferRendered = false;

                uiList1.AddControl(item);
            }

            //Call of EndAddControls method when the UIListItems binding is done  
            uiList1.EndAddControls();
            //HideFrame(uiPanel1);
            //ShowFrame(this.panel1, "Panel1");
        }
        catch (Exception ex)
        {
            UIMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK,
                   UIMessageIcons.Done, UIColorSchemesCustom.Orange);
        }
    }

    private void ShowFrame(Panel panel)
    {
        Panel pnlPanel = new Panel();
        pnlPanel = panel;
        //pnlPanel.Location = new System.Drawing.Point(0, 0);
        pnlPanel.Show();
        pnlPanel.BringToFront();
    }


    private void HideFrame(Panel panel)
    {
        Panel pnlPanel = new Panel();
        pnlPanel = panel;
        pnlPanel.Hide();
    }

Thanks in advance
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900