草庐IT

media-buttons

全部标签

c# - 在 asp :repeater on button click event 中找到控件

我在asp:repeater项目模板中有一个下拉列表。我怎样才能在按钮点击事件中获得它的值(value)。protectedDropDownListddlWorkflowMembers=newDropDownList();protectedvoidWorkflowListAfterItemCreated(objectsender,RepeaterItemEventArgse){ddlWorkflowMembers=(DropDownList)e.Item.FindControl("ddlWorkflowMembers");}protectedvoidBtnSaveClick(objec

c# - 如何将 ImageSource 设置为 Xamarin.Forms.Button?

我正在尝试使用按钮中的图像属性添加背景图像。我面临的问题是我无法将StreamImageSource设置为按钮背景。如果我尝试这样做,我遇到了下面给出的错误。我用来设置图片的代码:ImageSourceiconsource=ImageSource.FromStream(()=>newMemoryStream(ImgASBytes));ButtonIcon=newButton();Icon.Image=iconsource;我遇到的错误:错误CS0266:无法将类型“Xamarin.Forms.ImageSource”隐式转换为“Xamarin.Forms.FileImageSource

c# - 如何将 System.Drawing.font 转换为 System.Windows.Media.Fonts 或 TypeFace?

如何将System.Drawing.Font转换为System.Windows.Media.Fonts或TypeFace?或者如何从System.Drawing.Font的实例生成System.Windows.Media.Fonts或TypeFace的实例? 最佳答案 你不能实例化Media.Fonts,但我认为你可以得到一个Media.FontFamily这就是我实现它的方法。usingSystem.Drawing;usingMedia=System.Windows.Media;Fontfont=newFont(newSystem

c# - 将 WPF Button CommandParameter 绑定(bind)到 DataTemplate 中的 Button 本身

我有一个DataTemplate,代表我通过自定义AppBarCommand对象集合声明的AppBar按钮。publicAppBarCommand(RelayCommandcommand,stringbuttonstyle){Command=command;ButtonStyle=buttonstyle;}我想添加一个CommandParameter绑定(bind),但参数必须是Button本身。这样我就可以设置Callisto弹出窗口的PlacementTarget。这可能吗? 最佳答案 您的Command属性应该是RelayCo

C# WinForm : Remove or Customize the 'Focus Rectangle' for Buttons 格式

有没有办法禁用或更好地为常规按钮控件绘制您自己的焦点矩形!(那条虚线看起来很像Windows95ish)我注意到控件属性(FORBUTTONS)没有ownerdrawfixed设置(我不知道这是否是用于解决方案的路径,尽管我已经看到它用于自定义其他控件). 最佳答案 要做到这一点比听起来要棘手。毫无疑问,自定义按钮绘制不可覆盖的原因之一。这按预期工作:usingSystem;usingSystem.Drawing;usingSystem.Windows.Forms;usingSystem.Windows.Forms.VisualSt

c# - 将 Color 转换为像 #XXXXXX 这样的字符串到 System.Windows.Media.Brush 的最简单方法

我觉得标题很清楚!我现在拥有的是:System.Drawing.Coloruiui=System.Drawing.ColorTranslator.FromHtml(myString);varintColor=(uint)((uiui.A1-myString就像我在标题中所说的#FFFFFF2-这在BitConverter.GetBytes行上失败了,这让我感到惊讶,因为我在Color上得到了int表示!3-无论如何,我知道颜色转换不是那么直观,但我觉得我做的不对...这是好方法吗? 最佳答案 您可以使用System.Windows.

c# - 如何使用System.Media.SoundPlayer异步播放声音文件?

这是一个看似简单的问题:在Windows窗体中异步播放嵌入式.wav资源文件的正确方法是什么?尝试#1:varplayer=newSoundPlayer();player.Stream=Resources.ResourceManager.GetStream("mySound");player.Play();//NotethatPlayisasynchronous好:不会阻塞UI线程差:SoundPlayer和嵌入式资源流不是立即处置。尝试#2:using(varaudioMemory=Resources.ResourceManager.GetStream("mySound")){usi

c# - MVC5 : Enum radio button with label as displayname

我有这些枚举publicenumQuestionStart{[Display(Name="Repeattillcommonmatchisfound")]RepeatTillCommonIsFound,[Display(Name="Repeatonce")]RepeatOnce,[Display(Name="Norepeat")]NoRepeat}publicenumQuestionEnd{[Display(Name="CancelInvitation")]CancelInvitation,[Display(Name="Planwithparticipantsonfirstavailab

c# - MVC : what code gets called when you click the "submit" button?

MVC新手问题;我通过玩耍而不是阅读手册来学习...:)我在创建“编辑”View时发现自动生成的View包含一个“提交”按钮:但是在幕后调用什么代码来执行此保存操作?具体来说,这个View的基础模型在我想要调用的代码中有自己的奇特保存逻辑。我如何让View调用我的代码,而不是在幕后无形地调用任何标准代码? 最佳答案 定义发生什么的不是按钮,而是表单本身。提交类型的按钮(每个表单一个)仅触发表单提交,由表单本身处理。一个表单有一个Action——例如:操作是一个URL,浏览器会收集表单中所有字段的值()并将它们发布到指定的url。在A

c# - wpf 中的 button1.PerformClick()

为什么WPF中的这段代码不起作用?privatevoidbutton1_Click(objectsender,EventArgse){MessageBox.Show("yes");}privatevoidForm1_Load(objectsender,EventArgse){button1.PerformClick();}我需要指挥。 最佳答案 要使用windows窗体应用的样式,需要编写如下扩展方法:namespaceSystem.Windows.Controls{publicstaticclassMyExt{publicstat