home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frmSeznam
- BorderStyle = 1 'Fixed Single
- Caption = "Drag&drop"
- ClientHeight = 2520
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 4050
- Icon = "frmSeznam.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 2520
- ScaleWidth = 4050
- StartUpPosition = 3 'Windows Default
- Begin VB.TextBox txtCil
- Height = 375
- Left = 2040
- TabIndex = 4
- Top = 360
- Width = 1935
- End
- Begin VB.TextBox txtZdroj
- DragIcon = "frmSeznam.frx":014A
- Height = 375
- Left = 0
- TabIndex = 2
- Top = 360
- Width = 1935
- End
- Begin VB.ListBox lstCil
- Height = 1620
- Left = 2040
- TabIndex = 1
- Top = 840
- Width = 1935
- End
- Begin VB.ListBox lstZdroj
- DragIcon = "frmSeznam.frx":0294
- Height = 1620
- Left = 0
- TabIndex = 0
- Top = 840
- Width = 1935
- End
- Begin VB.Label Label2
- Caption = "C
- Height = 255
- Left = 2160
- TabIndex = 5
- Top = 120
- Width = 975
- End
- Begin VB.Label Label1
- Caption = "Zdroj"
- Height = 255
- Left = 120
- TabIndex = 3
- Top = 120
- Width = 615
- End
- Attribute VB_Name = "frmSeznam"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- ' Prom
- pro ulo
- ozna
- ho textu
- Private VybranyText As String
- Private Sub Form_Load()
- lstZdroj.AddItem "jeden"
- lstZdroj.AddItem "dva"
- lstZdroj.AddItem "t
- lstZdroj.AddItem "
- lstZdroj.AddItem "p
- lstZdroj.AddItem "
- End Sub
- Private Sub lstCil_DragDrop(Source As Control, X As Single, Y As Single)
- ' Zdrojem je Listbox
- If TypeOf Source Is ListBox Then
- ' P
- se polo
- ka ozna
- ve zdrojov
- m ListBoxu
- lstCil.AddItem Source.List(Source.ListIndex)
- End If
- ' Zdrojem je TextBox
- If TypeOf Source Is TextBox Then
- ' P
- se obsah prm
- VybranyText, kter
- ' obsahuje ozna
- text z TextBoxu
- lstCil.AddItem VybranyText
- ' Vypr
- prom
- VybranyText = ""
- End If
- End Sub
- Private Sub lstZdroj_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- ' Zah
- lstZdroj.Drag
- End Sub
- Private Sub txtCil_DragDrop(Source As Control, X As Single, Y As Single)
- ' Stejn
- postup jako u lstCil_DragDrop
- If TypeOf Source Is ListBox Then
- txtCil.SelText = Source.List(Source.ListIndex)
- End If
- If TypeOf Source Is TextBox Then
- txtCil.SelText = VybranyText
- VybranyText = ""
- End If
- End Sub
- Private Sub txtZdroj_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- ' Pokud je n
- co v prom
- se ta
- ' Po ukon
- je prom
- vypr
- If Len(VybranyText) > 0 Then txtZdroj.Drag
- End Sub
- Private Sub txtZdroj_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- ' Pokud je vzbr
- text, ulo
- se do prom
- If txtZdroj.SelLength > 0 Then VybranyText = txtZdroj.SelText
- End Sub
-