在Windows Mobile 6.0中使用外部Spinner控件

时间:2012-11-15 10:16:41

标签: windows-mobile-6

我在我的项目中使用了slideUI控件。有一个微调器控件用作等待光标。我想在List中加载数据时显示微调器。 但是当我尝试显示微调器时,它可视化为图像而不是旋转图像。

以下是我的代码。

  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();
    }

提前致谢

0 个答案:

没有答案