我正在研究类似于玛雅高射线的分光,其中我可以把诺德与拖拉和下降联系起来。 由于目标对象可以有数项投入,我想创建一种临时背景标准,以选择投入作为在以下模拟中的建议:
我曾尝试过相当长时间,以启动或开放背景。 它像Win32轨道PopupMenu那样,我所期待的是什么。 是否有WPF/C#等值?
Thanks pixtur
我使用以下法典在一份一览表中附上一个背景:
<ListView ... MouseUp="ListView_MouseUp">
在代码背后一栏中,为显示背景图例:
private void ListView_MouseUp(object sender, MouseButtonEventArgs e)
{
DependencyObject depObj = e.OriginalSource as DependencyObject;
while (depObj != null && (!(depObj is GridViewColumnHeader)))
{
depObj = VisualTreeHelper.GetParent(depObj);
}
if (depObj is GridViewColumnHeader && e.ChangedButton == MouseButton.Left)
{
((GridViewColumnHeader)depObj).ContextMenu = ContextMenu;
}
}
The variable ContextMenu refers to a contextmenu instance that i created bfeorehand, you could also create the ContextMenu in the Mouse event handler. I m not sure if this helps as I dont know how you do the drag/drop, but it is worth a try
我建议另一种解决办法:
举例来说,一个纽州将提出一条目(Copy)正确点击。 如果点击“Copy”环境菜单项目,则会产生一个ole果。
[..]
var button = new Button();
button.Content = "SomeButtonName";
button.MouseUp += HandleMouseUp;
[..]
private void HandleMouseUp(object sender, MouseButtonEventArgs e)
{
var senderUIControl = sender as Control;
var contextMenu = new ContextMenu();
var item = new MenuItem();
item.Header = "Copy";
item.Click += (o, a) => {
Console.WriteLine("Copy item clicked");
};
contextMenu.Items.Add(item);
senderUIControl.ContextMenu = contextMenu;
}
What is the use of default keyword in C#? Is it introduced in C# 3.0 ?
I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...
I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...
I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...
I have two EF entities. One has a property called HouseNumber. The other has two properties, one called StartHouseNumber and one called EndHouseNumber. I want to create a many to many association ...
How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...
Since I cannot order my dictionary, what is the best way of going about taking key value pairs and also maintaing an index?
Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...