当前位置: 首页>>代码示例>>C#>>正文


C# Control.ToString方法代码示例

本文整理汇总了C#中Control.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Control.ToString方法的具体用法?C# Control.ToString怎么用?C# Control.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Control的用法示例。


在下文中一共展示了Control.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DisplayControls

 protected void DisplayControls(Control item, int depth)
 {
     if (item.Controls != null)
     {
         Page.Response.Write(new String('-', depth));
         Page.Response.Write(item.ToString() + "<br />");
         foreach (Control cntrl in item.Controls)
         {                
             DisplayControls(cntrl, depth++);               
         }            
     }
     else
     {
         Page.Response.Write(item.ToString() + "<br />");
     }       
 }
开发者ID:naynishchaughule,项目名称:ASP.NET,代码行数:16,代码来源:PageContainer.aspx.cs

示例2: DeriveControlName

 public static string DeriveControlName(Control control)
 {
     if (control != null)
     {
         try
         {
             string str = control.ToString();
             int i = str.LastIndexOf(".");
             return str.Remove(0, i + 1);
         }
         catch
         {
             return control.ToString();
         }
     }
     return control.ToString();
 }
开发者ID:KtBkkr,项目名称:Asteria,代码行数:17,代码来源:Utilities.cs

示例3: FromControl

            public static ControlTemplate FromControl(Control control)
            {
                ControlTemplate ct = new ControlTemplate();

                ct.Name = control.Name;
                ct.Class = control.ToString();
                ct.Properties = new List<PropertyTemplate>
                                             {
                                                 new PropertyTemplate("Left", control.Left),
                                                 new PropertyTemplate("Top", control.Top),
                                                 new PropertyTemplate("MinimumWidth", control.MinimumWidth),
                                                 new PropertyTemplate("Height", control.Height),
                                                 new PropertyTemplate("Width", control.Width),
                                                 new PropertyTemplate("Anchor", (int) control.Anchor),                                                                             
                                             };

                if (control.Text != null)
                    ct.Properties.Add(new PropertyTemplate("Text", control.Text));

                if (control.StayOnBack)
                    ct.Properties.Add(new PropertyTemplate("StayOnBack", control.StayOnBack));

                if (control.Passive)
                    ct.Properties.Add(new PropertyTemplate("Passive", control.Passive));

                if (control is Label)
                    ct.Properties.Add(new PropertyTemplate("Alignment", (int) (control as Label).Alignment));

                //if (control is ImageBox)
                //    ct.Properties.Add(new PropertyTemplate("Image", (control as ImageBox).Image));

                ct.Controls = new List<ControlTemplate>();

                foreach (var c in control.Controls)
                    ct.Controls.Add(FromControl(c));

                return ct;
            }
开发者ID:mrommel,项目名称:MiRo.SimHexWorld,代码行数:38,代码来源:LayoutTemplate.cs

示例4: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        parent = messages.GetParentOfType(this.Parent
                                         );

        BLItems.navigateCat += new EventHandler(subCatAction);

        if (!IsPostBack)
        {
            switch (parent.ToString())
            {
                case "orgproducts_aspx":

                    break;
            }

            //      txtPriceEnd

            //if (!IsPostBack)
            //{

            messages.cnt = 0;
            messages.arCats = new String[20];

           /// DataSet ds = UpdateDonate("R", "get_Categories", 0, "");
           ///
            BLCustomer cst = (BLCustomer)custs();
            DataSet ds = orgs().Category.GetCatList(ref cst, "R", "get_Categories", 0, "");

            custs_ = cst;

            lstcat.DataSource = ds;
            lstcat.DataBind();

            lstcat.Items.Insert(0, "All Categories");

            //}
        }
    }
开发者ID:elieli,项目名称:nonProfit,代码行数:39,代码来源:category.ascx.cs

示例5: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (drplstCPage.SelectedIndex == -1)

            { drplstCPage.SelectedValue = BLItems.pager <= 0 ? "1" : BLItems.pager.ToString(); }

            if (drplstPageSize.SelectedIndex == -1)
            { drplstPageSize.SelectedValue = items().rowlimit.ToString(); }

                     TotalPages.Text = (BLItems.totpage).ToString();
                     ///////////////////////////CurrentPage.Text = (BLItems.pager - 1).ToString();

          ///    messages.navigate += new EventHandler(NavigationLink_Click);

            if (!IsPostBack)
            {

                parent = messages.GetParentOfType(this.Parent);

                switch (parent.ToString())
                {
                    case "orgproducts_aspx":
                    case "ASP.orgproducts_aspx":
                    case "orgproducts_ascx":

                        ds = ((BLCustomer)messages.cust).Organization.Orgitems.Items;
                        ////datalist = messages.datalist;

                    ////////    DataTable dataTable = (DataTable)(((BLCustomer)messages.cust).Organization.Orgitems.ItemsDV).Table;

                        break;

                    case "auction_aspx":
                        // messages.DataTable = dataTable;
                        Response.Redirect("orgproducts.aspx?");

                        break;

                }

                ////////////if (IsPostBack)
                ////////////{

                ////////////    ///////////////  DataTable dataTable = messages.DataTable != null ? messages.DataTable : null;

                ////////////    DataTable dataTable = (DataTable)((DataView)((DataList)this.Parent.FindControl("dtalstItems")).DataSource).Table;
                ////////////    DataList dtalstItems = (DataList)datalist;

                ////////////    DataView dv = new DataView();

                ////////////    dv.Table = dataTable;

                ////////////    dtalstItems.DataSource = dv;// dataTable;
                ////////////    dtalstItems.DataBind();

                ////////////}

            }
    }
开发者ID:elieli,项目名称:nonProfit,代码行数:59,代码来源:pageing.ascx+-+Copy.cs


注:本文中的Control.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。