且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

是否有类似于C#的C#

更新时间:2022-06-27 01:05:11

System.Windows.Forms.Button(对于System.Windows.Forms),System.Windows.Controls.Button(对于WPF).您可以应该子类化这些类(或更确切地说,它们的基类).另一种方法(通常是更好的方法)是Control的子类(两个库都具有此类,Button是间接从其派生的).



有关鼠标悬停行为的后续问题将作为一个单独的答案回答.

—SA
System.Windows.Forms.Button (for System.Windows.Forms), System.Windows.Controls.Button (for WPF). You should can subclass those classes (or rather their base classes). Alternatively (usually better way) you subclass Control (both libraries have such class, Button is derived from it indirectly).



The follow-up Question on mouse hovering behavior is answered as a separate Answer.

—SA


我没有浏览链接,但是如果VB.Net中存在该链接,则可以在C#项目中添加对该dll的引用并立即使用它.
I have not gone through the link but if that is there in VB.Net, then you can add a reference to that dll in your C# project and use it right away.


回答后续问题:如何处理鼠标悬停在控件上的方法,可以覆盖System.Windows.Controls.Control.OnMouseEnter/OnMouseLeave或处理事件System.Windows.Controls.Control.MouseEnter/.

现在我对OP提出了一个问题:您打算在多长时间内针对您可能需要的每个功能提出这样的问题?毕竟,请查看类System.Windows.Controls.Control上的帮助,如果仍然有问题,请提出一些实际问题.以防万一,看看System.Windows.FrameworkElement及其相关内容.

参见
http://msdn.microsoft.com/en-us/library/system. windows.controls.control.aspx [ ^ ]
http://msdn.microsoft.com/en-us/library/system.windows. frameworkelement.aspx [ ^ ]…

我需要解释如何做吗?我可以始终始终将适当的参考放在方便的地方……

—SA
Answering the follow-up Question: how to handle mouse hovering over the control either override System.Windows.Controls.Control.OnMouseEnter/OnMouseLeave or handle events System.Windows.Controls.Control.MouseEnter/MouseLeave.

Now I have a question to OP: how long do you plan to ask questions like that, on every feature you may possibly need? After all, look at the help on the class System.Windows.Controls.Control and ask some real questions if you still have problems. Just in case, take a look at System.Windows.FrameworkElement and related stuff.

See
http://msdn.microsoft.com/en-us/library/system.windows.controls.control.aspx[^]
http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.aspx[^]…

Do I have to explain how to do it? I can, always keep appropriate reference handy…

—SA