我无法将任何控件添加到我的视觉工作室

编程入门 行业动态 更新时间:2024-10-21 16:01:58
本文介绍了我无法将任何控件添加到我的视觉工作室的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

嗨 我的Visual Studio无法正常工作 我无法从工具箱中将任何控件添加到表单. 我正在修理. 问题仍然存在. 我现在该怎么办? 我也正在卸载Visual Studio. 并再次设置 但问题仍然存在. 请帮帮我.

Hi My visual studio does''nt work corectly i cant add any control from my toolbox to the form. i was repair it. and the problem exist yet. what do i do now? also i was uninstall visual studio. and again setting up it but the problem exist yet. Please help me. cheers shahin.

推荐答案

我会说你几乎肯定做错了.您是否在许多项目中都尝试过?您确定文件不是只读的吗?您选择一个控件,然后单击该表单将其添加? I would say you''re almost certainly not doing it right. Have you tried it across many projects ? Are you sure the files are not read only ? You select a control, then click the form to add it ?

1-请不要按"answer"来发布非答案 2-您希望我们做什么?我该如何修理您的计算机? Visual Studio适用于使用它的每个人,因此,除了您的安装以外,我看不到任何问题,或者,如果您删除并重新安装了该程序,那么问题就是我列出的问题之一.我们肯定会根据您含糊不清的帖子为您提供帮助. 1 - please don''t push ''answer'' to post a non answer 2 - what do you expect us to do ? How can I fix your computer ? Visual Studio works for everyone who uses it, so, I don''t see how the problem can be anything but your install or, if you''ve removed and reinstalled the program, then the issue is one of the things I listed. We sure as hell cannot help you based on your vague posts.

只需在c#中创建自定义cortrol < pre lang ="cs">使用System.ComponentModel; 使用System.Security.Permissions; 使用System.Web; 使用System.Web.UI; 使用System.Web.UI.WebControls; 命名空间Samples.AspNet.CS.Controls { [ AspNetHostingPermission(SecurityAction.Demand, 级别= AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), DefaultProperty(& quot;文本& quot;), ToolboxData(& lt; {0}:WelcomeLabel runat = \&服务器\& quot;& lt;/{0}:WelcomeLabel& quot;) ] 公共类WelcomeLabel:WebControl { [ 可绑定(true), 类别(外观"), DefaultValue(&&"), 说明(&欢迎消息文本."), 可本地化(true) ] 公共虚拟字符串Text { 获取 { 字符串s =(string)ViewState [& quot; Text& quot;] ;; 返回(s == null)吗? String.Empty:s; } 设置 { ViewState [& quot;文本& quot]] =值; } } 受保护的重写void RenderContents(HtmlTextWriter writer) { writer.WriteEncodedText(Text); 如果(上下文!= null) { 字符串s = Context.User.Identity.Name; if(s!= null&& s!= String.Empty) { string [] split = s.Split(&#39; \\&#39;); int n = split.Length-1; 如果(split [n]!= String.Empty) { writer.Write(&,& quot;); writer.Write(split [n]); } } } writer.Write(&!& quot;); } } }</pre> 然后按照以下步骤操作. < b>•创建ASP.NET服务器控件. •将元数据添加到控件及其成员,以控制安全性和设计时行为. •使用ASP.NET网站中的App_Code目录来测试您的控件,而无需手动编译步骤. •在配置文件和控件的程序集中指定标签前缀. •将控件编译为程序集并将其添加到Bin目录. •将位图作为控件的工具箱图标嵌入到控件的程序集中. •在页面中使用编译后的控件.</b> just create a custom cortrol in c# <pre lang="cs">using System.ComponentModel; using System.Security.Permissions; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace Samples.AspNet.CS.Controls { [ AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal), DefaultProperty(&quot;Text&quot;), ToolboxData(&quot;&lt;{0}:WelcomeLabel runat=\&quot;server\&quot;&gt; &lt;/{0}:WelcomeLabel&gt;&quot;) ] public class WelcomeLabel : WebControl { [ Bindable(true), Category(&quot;Appearance&quot;), DefaultValue(&quot;&quot;), Description(&quot;The welcome message text.&quot;), Localizable(true) ] public virtual string Text { get { string s = (string)ViewState[&quot;Text&quot;]; return (s == null) ? String.Empty : s; } set { ViewState[&quot;Text&quot;] = value; } } protected override void RenderContents(HtmlTextWriter writer) { writer.WriteEncodedText(Text); if (Context != null) { string s = Context.User.Identity.Name; if (s != null &amp;&amp; s != String.Empty) { string[] split = s.Split(&#39;\\&#39;); int n = split.Length - 1; if (split[n] != String.Empty) { writer.Write(&quot;, &quot;); writer.Write(split[n]); } } } writer.Write(&quot;!&quot;); } } }</pre> then follow the folowing steps. <b>•Create an ASP.NET server control. •Add metadata to the control and its members to control security and design-time behavior. •Use the App_Code directory in an ASP.NET Web site to test your control without manual compilation steps. •Specify a tag prefix in a configuration file and in the control''s assembly. •Compile the control into an assembly and add it to the Bin directory. •Embed a bitmap into the control''s assembly as the toolbox icon for a visual designer. •Use the compiled control in a page.</b>

更多推荐

我无法将任何控件添加到我的视觉工作室

本文发布于:2023-11-06 13:45:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1563859.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:控件   视觉   工作室

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!