home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 March / Chip_2000-03_cd.bin / servis / tipy / files / DRAGDROP.ZIP / frmSeznam.frm (.txt) next >
Encoding:
Visual Basic Form  |  1999-01-07  |  3.7 KB  |  133 lines

  1. VERSION 5.00
  2. Begin VB.Form frmSeznam 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Drag&drop"
  5.    ClientHeight    =   2520
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   4050
  9.    Icon            =   "frmSeznam.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   2520
  14.    ScaleWidth      =   4050
  15.    StartUpPosition =   3  'Windows Default
  16.    Begin VB.TextBox txtCil 
  17.       Height          =   375
  18.       Left            =   2040
  19.       TabIndex        =   4
  20.       Top             =   360
  21.       Width           =   1935
  22.    End
  23.    Begin VB.TextBox txtZdroj 
  24.       DragIcon        =   "frmSeznam.frx":014A
  25.       Height          =   375
  26.       Left            =   0
  27.       TabIndex        =   2
  28.       Top             =   360
  29.       Width           =   1935
  30.    End
  31.    Begin VB.ListBox lstCil 
  32.       Height          =   1620
  33.       Left            =   2040
  34.       TabIndex        =   1
  35.       Top             =   840
  36.       Width           =   1935
  37.    End
  38.    Begin VB.ListBox lstZdroj 
  39.       DragIcon        =   "frmSeznam.frx":0294
  40.       Height          =   1620
  41.       Left            =   0
  42.       TabIndex        =   0
  43.       Top             =   840
  44.       Width           =   1935
  45.    End
  46.    Begin VB.Label Label2 
  47.       Caption         =   "C
  48.       Height          =   255
  49.       Left            =   2160
  50.       TabIndex        =   5
  51.       Top             =   120
  52.       Width           =   975
  53.    End
  54.    Begin VB.Label Label1 
  55.       Caption         =   "Zdroj"
  56.       Height          =   255
  57.       Left            =   120
  58.       TabIndex        =   3
  59.       Top             =   120
  60.       Width           =   615
  61.    End
  62. Attribute VB_Name = "frmSeznam"
  63. Attribute VB_GlobalNameSpace = False
  64. Attribute VB_Creatable = False
  65. Attribute VB_PredeclaredId = True
  66. Attribute VB_Exposed = False
  67. ' Prom
  68.  pro ulo
  69.  ozna
  70. ho textu
  71. Private VybranyText As String
  72. Private Sub Form_Load()
  73.     lstZdroj.AddItem "jeden"
  74.     lstZdroj.AddItem "dva"
  75.     lstZdroj.AddItem "t
  76.     lstZdroj.AddItem "
  77.     lstZdroj.AddItem "p
  78.     lstZdroj.AddItem "
  79. End Sub
  80. Private Sub lstCil_DragDrop(Source As Control, X As Single, Y As Single)
  81.     ' Zdrojem je Listbox
  82.     If TypeOf Source Is ListBox Then
  83.         ' P
  84.  se polo
  85. ka ozna
  86.  ve zdrojov
  87. m ListBoxu
  88.         lstCil.AddItem Source.List(Source.ListIndex)
  89.     End If
  90.     ' Zdrojem je TextBox
  91.     If TypeOf Source Is TextBox Then
  92.         ' P
  93.  se obsah prm
  94.  VybranyText, kter
  95.         ' obsahuje ozna
  96.  text z TextBoxu
  97.         lstCil.AddItem VybranyText
  98.         ' Vypr
  99.  prom
  100.         VybranyText = ""
  101.     End If
  102. End Sub
  103. Private Sub lstZdroj_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  104.     ' Zah
  105.     lstZdroj.Drag
  106. End Sub
  107. Private Sub txtCil_DragDrop(Source As Control, X As Single, Y As Single)
  108.     ' Stejn
  109.  postup jako u lstCil_DragDrop
  110.     If TypeOf Source Is ListBox Then
  111.         txtCil.SelText = Source.List(Source.ListIndex)
  112.     End If
  113.     If TypeOf Source Is TextBox Then
  114.         txtCil.SelText = VybranyText
  115.         VybranyText = ""
  116.     End If
  117. End Sub
  118. Private Sub txtZdroj_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  119.     ' Pokud je n
  120. co v prom
  121.  se ta
  122.     ' Po ukon
  123.  je prom
  124.  vypr
  125.     If Len(VybranyText) > 0 Then txtZdroj.Drag
  126. End Sub
  127. Private Sub txtZdroj_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  128.     ' Pokud je vzbr
  129.  text, ulo
  130.  se do prom
  131.     If txtZdroj.SelLength > 0 Then VybranyText = txtZdroj.SelText
  132. End Sub
  133.