如何以编程方式向Ellipse添加行为? (C#) [英] How do I add a behavior to an Ellipse programmatically? (c#)

查看:165
本文介绍了如何以编程方式向Ellipse添加行为? (C#)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

提前谢谢!

推荐答案

您好,您想要做的是打开xaml.cs文件(右键单击它并选择编辑视觉工作室,或者如果使用混合3,双击它)
这将允许您直接编辑它。如果要设置鼠标悬停,单击等行为,则在xaml文件中转到事件面板(闪电),然后在要为其创建事件处理程序的任何事件的文本框中双击。这将自动生成事件处理程序并打开xaml.cs文件,您可以在其中添加cs代码。
Hi Bolly, what you want to do is open the xaml.cs file(right click on it and choose edit in visual studio, or if using blend 3, double click it)
This will allow you to edit it directly. If you want to set up behavior such as mouse over, click, etc, then in the xaml file go to the events panel (lightning bolt) and double click within the textbox of whichever event you would like to create an event handler for. This will automatically generate the event handler and open up the xaml.cs file, where you can add your cs code.


这篇关于如何以编程方式向Ellipse添加行为? (C#)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆