zoukankan      html  css  js  c++  java
  • 自定义控件无法在VS.net编辑中显示

    自己写了一个用户控件,拖入到编辑框只有如下图的样子,连鼠标都无法选中,怎么解决?

    ----------图片下方--------------------


    而正常的控件应该是:


    ===============
    update by rock jing on 2004-9-25
    ===============
    我定义了设计时的类,用来显示,设计时候控件显示的模样。
    public class SampleDesign
        
    {
            
    public class SampleDesigner : System.Web.UI.Design.ControlDesigner
            
    {

                
    public override string GetDesignTimeHtml() 
                
    {
                    
    // Component is the control instance, defined in the base
                    
    // designer
                    MyLabel myLable = (MyLabel)this.Component;
                    
    string html = myLable.GetHtml();

                    
    return html;

                }

                
    protected override string GetEmptyDesignTimeHtml()
                
    {
                    String html 
    =  base.GetEmptyDesignTimeHtml ();
                    html 
    = "<input type='text'"+html+">";
                    
    return html;
                }

                
    protected override string GetErrorDesignTimeHtml(Exception e)
                
    {

                    String html 
    =  base.GetErrorDesignTimeHtml (e);
                    html 
    = "<input type='text'"+html+">";
                    
    return html;
                }



            

            }


        }

    结果,出现了创建控件出错。指定转换无效

  • 相关阅读:
    【vim】分割窗口、标签页与Quickfix窗口
    新手学cocos2dx,centos7下的安装过程
    外部排序,杀鸡焉用牛刀?
    5亿整数的大文件,怎么排?
    【Hadoop】HDFS
    你好,树
    写给博客园博客团队,md的预览在哪里?
    老菜鸟致青春,程序员应该选择java 还是 c#-
    高性能server分析
    高性能服务端漫谈
  • 原文地址:https://www.cnblogs.com/king_astar/p/46519.html
Copyright © 2011-2022 走看看