ListViewBase.IsDragSource 方法

定義

傳回值,這個值表示清單檢視是否同時是拖放作業中的拖放來源和置放目標。

public:
 virtual bool IsDragSource() = IsDragSource;
bool IsDragSource();
public bool IsDragSource();
function isDragSource()
Public Function IsDragSource () As Boolean

傳回

Boolean

bool

如果清單檢視同時是拖放目標,則為true;否則為false

Windows 需求

裝置系列
Windows 10 Anniversary Edition (已於 10.0.14393.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v3.0 引進)

備註

如需詳細資訊,請參閱 拖放

版本相容性

IsDragSource 方法在 Windows 10 1607 版之前無法使用。 如果您的應用程式在 Microsoft Visual Studio 中的「最低平臺版本」設定小於此頁面稍後需求區塊中顯示的「引進版本」,您必須設計和測試您的應用程式以考慮此專案。 如需詳細資訊,請參閱 版本調適型程式碼

若要避免在舊版Windows 10上執行應用程式時發生例外狀況,請勿在未先執行執行時間檢查的情況下呼叫此方法。 此範例示範如何使用 ApiInformation 類別來檢查這個方法是否存在,然後再使用它。

if (ApiInformation.IsMethodPresent("Windows.UI.Xaml.Controls.ListViewBase", "IsDragSource"))
{
    bool isDragSource = listView1.IsDragSource();
}

適用於