تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
طلب ممكن مثال عن السحب والافلات
#1
السلام عليمكم
ممكن يا شباب
مثال عن السحب والافلات بالفيجوال بيسك 6

وجدت مثال ولكنه دوت نت

انتظركم

ملاحظه الى الاخ 3amo ممكن تشوف التنبيهات رسائل الزورار عندك
الرد }}}
تم الشكر بواسطة:
#2
السلام عليكم ورحمة الله وبركاته

تفضل مثال جاهز في المرفقات

كود :
Option Explicit

'' 2 ListBox

Private Sub Form_Load()

    List1.AddItem "عبدالله"
    List1.AddItem "محمد"
    List1.AddItem "جمال"
    List1.AddItem "مصطفى"
    
    List1.OLEDropMode = vbOLEDropManual
    List2.OLEDropMode = vbOLEDropManual
    
End Sub

Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    List1.OLEDrag
End Sub

Private Sub List1_OLEStartDrag(Data As DataObject, AllowedEffects As Long)
    AllowedEffects = vbDropEffectMove
    Data.SetData List1
End Sub

Private Sub List2_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
    Dim strList As String
    If Not Data.GetFormat(vbCFText) Then Exit Sub
    strList = Data.GetData(vbCFText)
    If Not strList = List2.Text Then
        List2.AddItem strList
        List1.RemoveItem List1.ListIndex
    End If
End Sub



Private Sub List2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    List2.OLEDrag
End Sub

Private Sub List2_OLEStartDrag(Data As DataObject, AllowedEffects As Long)
    AllowedEffects = vbDropEffectMove
    Data.SetData List2
End Sub


Private Sub List1_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
    Dim strList As String
    If Not Data.GetFormat(vbCFText) Then Exit Sub
    strList = Data.GetData(vbCFText)
    If Not strList = List1.Text Then
        List1.AddItem strList
        List2.RemoveItem List2.ListIndex
    End If
End Sub

السلام عليكم ورحمة الله وبركاته


الملفات المرفقة
.rar   Drag and Drop ListBox items - 01.rar (الحجم : 4.91 ك ب / التحميلات : 115)
الرد }}}
تم الشكر بواسطة:



التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم