Dizeleri Bir Listbox'tan Diğerine Sürükleyip Bırakın - Baskı Önizleme +- AccessTr.neT (https://accesstr.net) +-- Forum: Microsoft Access (https://accesstr.net/forum-microsoft-access.html) +--- Forum: Access Cevaplanmış Soruları (https://accesstr.net/forum-access-cevaplanmis-sorulari.html) +--- Konu Başlığı: Dizeleri Bir Listbox'tan Diğerine Sürükleyip Bırakın (/konu-dizeleri-bir-listbox-tan-digerine-surukleyip-birakin.html) Sayfalar:
1
2
|
Dizeleri Bir Listbox'tan Diğerine Sürükleyip Bırakın - accessman - 23/01/2020 Visualbasic de yazılmış bu örneği accessde yapabilir miyiz Drag and drop strings from one ListBox to another in Visual Basic .NET ' Start a drag. Private Sub lst_MouseDown(ByVal sender As Object, ByVal e _ As System.Windows.Forms.MouseEventArgs) Handles _ lstFruits.MouseDown, lstAnimals.MouseDown Dim lst As ListBox = DirectCast(sender, ListBox) If e.Button = Windows.Forms.MouseButtons.Right Then Dim index As Integer = lst.IndexFromPoint(e.X, e.Y) If index <> ListBox.NoMatches Then Dim item As String = lst.Items(index) Dim drop_effect As DragDropEffects = _ lst.DoDragDrop( _ lst.Items(index), _ DragDropEffects.Move Or _ DragDropEffects.Copy) ' If it was moved, remove the item from this ' list. If drop_effect = DragDropEffects.Move Then ' See if the user dropped the item in this ' ListBox ' at a higher position. If lst.Items(index) = item Then ' The item has not moved. lst.Items.RemoveAt(index) Else ' The item has moved. lst.Items.RemoveAt(index + 1) End If End If End If End If End Sub Cvp: Dizeleri Bir Listbox'tan Diğerine Sürükleyip Bırakın - accessman - 23/01/2020 If the drag moves over a ListBox, the DragOver event gives the control a chance to allow or prohibit the drag. The following code checks whether the drag can provide a string as data. If so, then it checks whether the Ctrl key is down and allows a move or copy effect. ' Display the appropriate cursor. Private Sub lstFruits_DragOver(ByVal sender As Object, _ ByVal e As System.Windows.Forms.DragEventArgs) Handles _ lstFruits.DragOver, lstAnimals.DragOver Const KEY_CTRL As Integer = 8 If Not (e.Data.GetDataPresent(GetType(System.String))) _ Then e.Effect = DragDropEffects.None ElseIf (e.KeyState And KEY_CTRL) And _ (e.AllowedEffect And DragDropEffects.Copy) = _ DragDropEffects.Copy Then ' Copy. e.Effect = DragDropEffects.Copy ElseIf (e.AllowedEffect And DragDropEffects.Move) = _ DragDropEffects.Move Then ' Move. e.Effect = DragDropEffects.Move End If End Sub Cvp: Dizeleri Bir Listbox'tan Diğerine Sürükleyip Bırakın - accessman - 23/01/2020 ' Drop the entry in the list. Private Sub lstFruits_DragDrop(ByVal sender As Object, _ ByVal e As System.Windows.Forms.DragEventArgs) Handles _ lstFruits.DragDrop, lstAnimals.DragDrop If e.Data.GetDataPresent(GetType(System.String)) Then If (e.Effect = DragDropEffects.Copy) Or _ (e.Effect = DragDropEffects.Move) Then Dim lst As ListBox = DirectCast(sender, ListBox) Dim item As Object = _ CType(e.Data.GetData(GetType(System.String)), _ System.Object) Dim pt As Point = lst.PointToClient(New _ Point(e.X, e.Y)) Dim index As Integer = lst.IndexFromPoint(pt.X, _ pt.Y) If index = ListBox.NoMatches Then lst.Items.Add(item) Else lst.Items.Insert(index, item) End If End If End If End Sub Cvp: Dizeleri Bir Listbox'tan Diğerine Sürükleyip Bırakın - berduş - 23/01/2020 Her konuyu lütfen kendi bölümüne acınız. Cvp: Dizeleri Bir Listbox'tan Diğerine Sürükleyip Bırakın - accessman - 23/01/2020 ben bunu Access de yapmak istiyorum yani uyarlamak mümkünmü Cvp: Dizeleri Bir Listbox'tan Diğerine Sürükleyip Bırakın - berduş - 23/01/2020 Sitedeki sürükle bırak örneklerini incelediniz mi? |