Case $ButtonListMove
Eğer $RadioTekli seçili ise seçili olan tek dosya $ListV1 den $ListV2'e taşınsın.
Else
yani $RadioCoklu ise seçilenler kadar taşınsın istiyorum.
Case $ButtonList2Sil
Eğer $RadioTekli seçili ise seçili olan tek dosya $ListV2 den silinsin.
Else
yani $RadioCoklu ise seçilenler kadar silinsin istiyorum
Sorunumun olduğu kod bloğu
Kod: Tümünü seç
Case $ButtonListMove
If GUICtrlRead($RadioTekli) = 1 Then
For $s = 0 To _GUICtrlListView_GetItemCount($ListV1) - 1
If _GUICtrlListView_GetItemChecked($ListV1, $s) Then
$SelectFile = _GUICtrlListView_GetItemText($ListV1, $s)
FileMove(@ScriptDir & "\" & $SelectFile, @ScriptDir & "\" & "List2Klasorum", 1)
EndIf
Next
pressedMove()
Else
ConsoleWrite("Çoklu seçim Yaptınız seçtiklerinizin tümü taşınacak" & @CRLF)
pressedMove()
EndIf
Kod: Tümünü seç
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <File.au3>
#include <FileConstants.au3>
#include <GuiListView.au3>
Global $fTypes = "bmp|gif|png|jpg"
$Form1 = GUICreate("Form1", 420, 253)
$ListV1 = GUICtrlCreateListView("ListView 1", 8, 64, 186, 134, -1, BitOR($WS_EX_CLIENTEDGE, $LVS_EX_CHECKBOXES))
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 80)
FindFiles()
$ButtonListMove = GUICtrlCreateButton("List bir aktar List 2e", 8, 216, 187, 25)
$ListV2 = GUICtrlCreateListView("ListView 2", 207, 65, 186, 134, -1, BitOR($WS_EX_CLIENTEDGE, $LVS_EX_CHECKBOXES))
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 80)
$RadioTekli = GUICtrlCreateRadio("Tekli Taşıma", 304, 8, 113, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
$RadioCoklu = GUICtrlCreateRadio("Çoklu Taşıma", 304, 32, 113, 17)
$ButtonList2Sil = GUICtrlCreateButton("List 2 den Sil", 320, 218, 75, 25)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $ButtonListMove
If GUICtrlRead($RadioTekli) = 1 Then
For $s = 0 To _GUICtrlListView_GetItemCount($ListV1) - 1
If _GUICtrlListView_GetItemChecked($ListV1, $s) Then
$SelectFile = _GUICtrlListView_GetItemText($ListV1, $s)
FileMove(@ScriptDir & "\" & $SelectFile, @ScriptDir & "\" & "List2Klasorum", 1)
EndIf
Next
pressedMove()
Else
ConsoleWrite("Çoklu seçim Yaptınız seçtiklerinizin tümü taşınacak" & @CRLF)
pressedMove()
EndIf
EndSwitch
WEnd
Func pressedMove()
_GUICtrlListView_CopyItems($ListV1, $ListV2, 1)
EndFunc ;==>pressedMove
Func FindFiles($sType = "All Types")
_GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($ListV1))
Local $ext = "*." & $sType, $FL2A
If $sType = "All Types" Then $ext = "*.*"
$FL2A = _FileListToArray(@ScriptDir, $ext, 1)
If Not @error Then
For $i = 1 To $FL2A[0]
If $sType = "All Types" Then
Local $SST = StringSplit($fTypes, "|")
For $j = 1 To $SST[0]
If $SST[$j] = StringMid($FL2A[$i], StringInStr($FL2A[$i], ".", 0, -1) + 1) Then _
GUICtrlCreateListViewItem($FL2A[$i], $ListV1)
Next
ElseIf $sType <> "All Types" Then
If $sType = StringMid($FL2A[$i], StringInStr($FL2A[$i], ".", 0, -1) + 1) Then _
GUICtrlCreateListViewItem($FL2A[$i], $ListV1)
EndIf
Next
_GUICtrlListView_SetColumnWidth($ListV1, 0, $LVSCW_AUTOSIZE)
EndIf
EndFunc ;==>FindFiles