我是新來的表達混合。在開發桌面應用程序時,我收到一個錯誤,提示「在聲明類型中缺少部分修飾符」,但我已將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);}}} –