例
list1 list2 ...
他们的
OLEDragMode=1
OLEDropMode=1Private Sub List1_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
List1.AddItem Data.GetData(vbCFText)
End Sub
Private Sub List2_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
List2.AddItem Data.GetData(vbCFText)
End SubTry it
list1 list2 ...
他们的
OLEDragMode=1
OLEDropMode=1Private Sub List1_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
List1.AddItem Data.GetData(vbCFText)
End Sub
Private Sub List2_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
List2.AddItem Data.GetData(vbCFText)
End SubTry it
解决方案 »
- "[^.0-9\r]{1,}"涉及到的正则法知识点?
- VB高深问题,如何下载网页的所有分页
- 以VB为基础,Sort能在哪些地方用
- 查询语句!
- 【求助】vb中ADODB.Command执行sql语句,超长被截断了,怎么办?
- ====UserControl的一个简单问题:如何固定UserControl的大小?
- 超级链接问题,高手请进!
- 欢迎访问我的站点wellsoft.htun.net
- 初始化时,如何把光标移动到在TEXTBOX的第三行第四个字里
- 关于toolbar的问题,马上结贴
- 工程目录里~~除了窗口外还有 好多诸如~~.obj .frm的文件~这些文件到底是什么啊~
- 用EXCEL作报表程序有谁会,请高手说一说
================================================================================
VERSION 5.00
Begin VB.Form Form1
Caption = " Way to Drag Drop Listbox"
ClientHeight = 3015
ClientLeft = 60
ClientTop = 345
ClientWidth = 3735
LinkTopic = "Form1"
ScaleHeight = 3015
ScaleWidth = 3735
StartUpPosition = 3 'Windows Default
Begin VB.ListBox List1
Height = 2010
Left = 240
TabIndex = 6
Top = 360
Width = 1455
End
Begin VB.PictureBox Picture1
BorderStyle = 0 'None
Height = 2055
Left = 240
ScaleHeight = 2055
ScaleWidth = 1455
TabIndex = 5
Top = 360
Width = 1455
End
Begin VB.CommandButton Command2
Caption = "Exit"
Height = 255
Left = 2760
TabIndex = 4
Top = 2640
Width = 855
End
Begin VB.CommandButton Command1
Caption = "Clear List"
Height = 255
Left = 1920
TabIndex = 3
Top = 2640
Width = 855
End
Begin VB.ListBox List2
Height = 2010
Left = 2040
TabIndex = 2
Top = 360
Width = 1455
End
Begin VB.Frame Frame2
Caption = "Favorites"
Height = 2415
Left = 1920
TabIndex = 1
Top = 120
Width = 1695
End
Begin VB.Frame Frame1
Caption = "Playlist"
Height = 2415
Left = 120
TabIndex = 0
Top = 120
Width = 1695
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim thesong As String
Dim takesong As StringPrivate Sub Command1_Click()
List2.Clear
End SubPrivate Sub Command2_Click()
Unload Me
End
End SubPrivate Sub Form_Load()
List1.AddItem "Song1"
List1.AddItem "Song2"
List1.AddItem "Song3"
List1.AddItem "Song4"
List1.AddItem "Song5"
End SubPrivate Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then Exit Sub
MousePointer = 0
takesong$ = ""
End SubPrivate Sub Frame1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then Exit Sub
takesong$ = ""
MousePointer = 0End SubPrivate Sub Frame2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then Exit Sub
takesong$ = ""
MousePointer = 0End SubPrivate Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If List1 = "" Then Exit Sub
If Button = 1 Then
thesong$ = List1.ListIndex
takesong$ = List1.List(thesong$)
MousePointer = 2
End If
End SubPrivate Sub List2_DblClick()
If List2 = "" Then Exit Sub
Dim a As String
a$ = List2.ListIndex
List2.RemoveItem a$
End SubPrivate Sub List2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If takesong$ = "" Then Exit Sub
List2.AddItem takesong$
takesong$ = ""
If Button = 0 Then MousePointer = 0
End Sub
我是由多个listbox之间移动,移动后必须删除原来的,尝试了很多方法,不行
List1.RemoveItem List1.ListIndex
End Sub