草庐IT

page-with-form

全部标签

c# - System.Windows.Forms.GroupBox 隐藏框架

在System.Windows.Forms.GroupBox上,有没有办法隐藏它周围的框架?我尝试更改FlatStyle,但这并没有达到我想要的效果。谢谢! 最佳答案 Panel可能是更好的选择,但如果您出于某种原因确实需要GroupBox,您可以修改代码here创建一个根本不绘制边框的子类。具体来说,您需要覆盖OnPaint方法。 关于c#-System.Windows.Forms.GroupBox隐藏框架,我们在StackOverflow上找到一个类似的问题:

c# - ViewCell 中的 Xamarin.Forms 按钮。如何处理事件?

我有一个带有按钮的自定义ViewCell。当我单击此按钮时,我想在显示带有ViewCell的ListView的ContentPage中处理此单击。在iOS中,我会使用来自Cell的委托(delegate)来执行此操作。我将如何在C#/Xamarin.Forms中执行此操作?这是我的自定义ViewCell:publicCustomCell(){button=newButton();button.Text="Add";button.VerticalOptions=LayoutOptions.Center;button.Clicked+=[WHATDODOHERE???];varnameLa

c# - 如何在 Xamarin.Forms 页面中将按钮作为 CommandParameter 从 XAML 传递?

我想将Xamarin.Forms.Button作为CommandParameter传递给我的ViewModel。我知道如何从后面的代码中实现这一点,例如...XAML(为简洁起见省略了大部分属性)XAML.cspublicpartialclassMyTestPage{publicMyTestPage(){InitializeComponent();myButton.CommandParameter=myButton;}}View模型publicclassMyViewModel:ViewModelBase{publicMyViewModel(){ButtonClickCommand=ne

c# - 如何使用 xamarin.forms 在弹出窗口中创建表单?

我正在使用Xamarin.forms,我需要在弹出View中有一个登录表单,如下图所示:现在我正在使用PushModalAsync,但这会使带有表单的新页面覆盖整个屏幕,而不是像我想要的那样只显示弹出View。有没有办法使用xamarin.forms来做到这一点?如果没有,是否已经实现了任何跨平台(Android、iOS和UWP)替代方案? 最佳答案 我的经验表明XLabs的PopupLayoutdoesn'tworkproperlysometimes.但是有一个非常好的库允许创建复杂的弹出窗口:Rg.Plugins.Popup.唯

c# - 如何避免 "Response.Redirect cannot be called in a Page callback"

我正在清理一些遗留框架代码,其中很大一部分只是通过异常编码。没有检查任何值以查看它们是否为空,因此会抛出和捕获大量异常。我已经清理了其中的大部分,但是,有一些错误/登录/安全相关的框架方法正在执行Response.Redirect,现在我们正在使用ajax,我们得到了很多"不能在页面回调中调用Response.Redirect。”我想尽可能避免这种情况。有没有办法以编程方式避免此异常?我正在寻找类似的东西if(Request.CanRedirect)Request.Redirect("url");请注意,Server.Transfer也会发生这种情况,因此我希望能够检查我是否能够执行R

c# - 低级差异 : non-static class with static method vs. 静态类与静态方法

我想知道使用具有静态方法的非静态类与具有相同静态方法的静态类的一般好处(或缺点)是什么,除了我不能使用非静态类中的静态方法作为扩展方法。例如:classNonStaticClass{publicstaticstringGetData(){return"Thiswasinvokedfromanon-staticclass.";}}与此相比:staticclassStaticClass{publicstaticstringGetData(){return"Thiswasinvokedfromastaticclass.";}}使用一种方法优于另一种方法对性能/内存有何影响?注意:假设我不需要

c# - 在 Xamarin.Forms 中绑定(bind)自定义 View

我在将Xamarin表单中的自定义View中的数据绑定(bind)到包含页面的View模型时遇到问题。我的自定义View很简单,一对标签代表一个键值对:后面的代码:publicpartialclassKeyValueView:ContentView{publicKeyValueView(){InitializeComponent();this.VerticalOptions=LayoutOptions.Start;this.BindingContext=this;}publicstaticreadonlyBindablePropertyValueProperty=BindablePro

c# - 编译器错误 : "error CS0307: The variable ' int' cannot be used with type arguments"

如果我有以下代码:privatevoidCheck(boola,boolb){}privatevoidCheck(inta,intb,intc,boolflag){Check(a(flag?c:b-10));}我在调用Check(int,int)时遇到编译时错误:errorCS0307:Thevariable'int'cannotbeusedwithtypearguments我也遇到了这些错误:errorCS0118:'b'isavariablebutisusedlikeatypeerrorCS0118:'a'isavariablebutisusedlikeatype为什么会出现这些错

c# - 在 Xamarin.Forms 中使用 Thread.Sleep

我要执行以下操作MainPage=newContentPage{Content=newStackLayout{Children={newButton{Text="Thread.Sleep",Command=newCommand(()=>{Thread.Sleep(1000);MainPage.Animate("",x=>MainPage.BackgroundColor=Color.FromRgb(x,x,x));}),},newButton{Text="Task.Run+Thread.Sleep",Command=newCommand(async()=>{awaitTask.Run((

c# - 无法将类型为 'ASP._Page_Areas_Admin__ViewStart_cshtml' 的对象转换为类型 'System.Web.WebPages.StartPage'

我创建了一个名为“Admin”的区域。在/Areas/Admin/Views/中,我有_ViewStart.cshtml:@{Layout="~/Areas/Admin/Views/Shared/_Layout.cshtml";}当我访问/Admin/中的页面时出现以下错误:无法将类型为“ASP._Page_Areas_Admin__ViewStart_cshtml”的对象转换为类型“System.Web.WebPages.StartPage”。我根据HowdoIuseacommon_ViewStartinareas?进行了建议的更改.我在根目录下的web.config中有这个,在/A