CheckedListBox에 드래그 드롭 재정렬 기능을 구현했습니다. 상단에서 끌어서 아래로 스크롤하면 정상 스크롤 막대가 자동 스크롤됩니다. (일반적인 드래그 드롭 자동 스크롤)DragDrop 재정렬을 사용하는 CheckedListBox 자동 스크롤
로드가 많은 WPF 정보를 찾았으나 그 솔루션을 어떻게 적용 할 수 있는지 보지 못했습니다. 내 winform ChekedListBox.
private void myListBox_DragOver(object sender, DragEventArgs e)
{
e.Effect = DragDropEffects.Move;
Point point = myListBox.PointToClient(new Point(e.X, e.Y));
int index = myListBox.IndexFromPoint(point);
int selectedIndex = myListBox.SelectedIndex;
if (index < 0)
{
index = selectedIndex;
}
if (index != selectedIndex)
{
myListBox.SwapItems(selectedIndex, index);
myListBox.SelectedIndex = index;
}
}
감사합니다. 약간 해키처럼 보이지만, 매우 똑똑한 구현입니다 ... 그리고 그것은 작동합니다! – Christoffer
오직 하나의 문제입니다. 스크롤하는 동안 (목록 상자 외부에서) 마우스 버튼을 놓으면 티커는 시작 모드로 유지됩니다. – Christoffer