我是新来的表达混合。在开发桌面应用程序时,我收到一个错误,提示“在声明类型中缺少部分修饰符”,但我已将partial
关键字置于public和class之间进行了更正。更正它后,我得到了下面的错误,我会感激你,如果你能好心给妥善解决这些错误声明类型缺少部分修饰符错误
The name 'startPoint' does not exist in the current context C:\Documents and Settings\acer\Desktop\my inter\rrrr\dragDrop(test1)\dragDrop(test1)\Window1.xaml.cs 24 9 dragDrop(test1)
The type or namespace name 'contact' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\acer\Desktop\my inter\rrrr\dragDrop(test1)\dragDrop(test1)\Window1.xaml.cs 67 32 dragDrop(test1)
The type or namespace name 'Contact' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\acer\Desktop\my inter\rrrr\dragDrop(test1)\dragDrop(test1)\Window1.xaml.cs 67 13 dragDrop(test1)
代码:
private void List_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
startPoint = e.GetPosition(null);
}
private void List_MouseMove(object sender, MouseEventArgs e)
{
Vector diff = startPoint - mousePos;
Contact contact = (contact)listView.ItemContainerGenerator.IndexFromContainer(listViewItem);
DataObject dragData = new DataObject("myFormat", contact);
}
private void DropList_Drop(object sender, DragEventArgs e)
{
listView.Items.Add(contact);
}
请从文件“Window1.xaml.cs”中发布相关代码。在第24行和第67行后面加上邮政编码。 –
private void List_PreviewMouseLeftButtonDown(object sender,MouseButtonEventArgs e){startPoint = e.GetPosition(null);} private void List_MouseMove(object sender,MouseEventArgs e){ Vector diff = startPoint - mousePos; 联系人联系人=(联系人)listView.ItemContainerGenerator.IndexFromContainer(listViewItem); DataObject dragData = new DataObject(“myFormat”,contact); { private void DropList_Drop(object sender,DragEventArgs e){ listView.Items.Add(contact);}}} –