home *** CD-ROM | disk | FTP | other *** search
/ distrib.akp.su/Programming/Vb-6+Rus/ / distrib.akp.su.tar / distrib.akp.su / Programming / Vb-6+Rus / VB98 / TEMPLATE / CONTROLS / TVLV.FRM < prev    next >
Text File  |  1998-06-27  |  6KB  |  186 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11d2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
  3. Begin VB.Form frmTreeviewListviewTemplate 
  4.    Caption         =   "ffff"
  5.    ClientHeight    =   5220
  6.    ClientLeft      =   -9996
  7.    ClientTop       =   2292
  8.    ClientWidth     =   5676
  9.    LinkTopic       =   "Form1"
  10.    LockControls    =   -1  'True
  11.    ScaleHeight     =   5220
  12.    ScaleWidth      =   5676
  13.    Begin VB.PictureBox picTitles 
  14.       Align           =   1  'Align Top
  15.       Appearance      =   0  'Flat
  16.       BorderStyle     =   0  'None
  17.       ForeColor       =   &H80000008&
  18.       Height          =   285
  19.       Left            =   0
  20.       ScaleHeight     =   462.08
  21.       ScaleMode       =   0  'User
  22.       ScaleWidth      =   5797.147
  23.       TabIndex        =   1
  24.       TabStop         =   0   'False
  25.       Top             =   0
  26.       Width           =   5676
  27.       Begin VB.Label lblTitle 
  28.          BorderStyle     =   1  'Fixed Single
  29.          Caption         =   " Treeview:"
  30.          Height          =   255
  31.          Index           =   0
  32.          Left            =   0
  33.          TabIndex        =   3
  34.          Top             =   15
  35.          Width           =   1995
  36.       End
  37.       Begin VB.Label lblTitle 
  38.          BorderStyle     =   1  'Fixed Single
  39.          Caption         =   " Listview:"
  40.          Height          =   255
  41.          Index           =   1
  42.          Left            =   2010
  43.          TabIndex        =   2
  44.          Top             =   15
  45.          Width           =   3180
  46.       End
  47.    End
  48.    Begin VB.PictureBox picSplitter 
  49.       BackColor       =   &H00808080&
  50.       BorderStyle     =   0  'None
  51.       FillColor       =   &H00808080&
  52.       Height          =   4800
  53.       Left            =   5400
  54.       ScaleHeight     =   5012.637
  55.       ScaleMode       =   0  'User
  56.       ScaleWidth      =   260
  57.       TabIndex        =   0
  58.       Top             =   315
  59.       Visible         =   0   'False
  60.       Width           =   156
  61.    End
  62.    Begin MSComctlLib.TreeView tvTreeView 
  63.       Height          =   4800
  64.       Left            =   -15
  65.       TabIndex        =   5
  66.       Top             =   315
  67.       Width           =   2010
  68.       _ExtentX        =   3535
  69.       _ExtentY        =   8467
  70.       _Version        =   393217
  71.       Style           =   7
  72.       Appearance      =   1
  73.    End
  74.    Begin MSComctlLib.ListView lvListView 
  75.       Height          =   4800
  76.       Left            =   2040
  77.       TabIndex        =   4
  78.       Top             =   315
  79.       Width           =   3210
  80.       _ExtentX        =   5673
  81.       _ExtentY        =   8467
  82.       LabelWrap       =   -1  'True
  83.       HideSelection   =   -1  'True
  84.       _Version        =   393217
  85.       ForeColor       =   -2147483640
  86.       BackColor       =   -2147483643
  87.       Appearance      =   1
  88.       NumItems        =   0
  89.    End
  90.    Begin VB.Image imgSplitter 
  91.       Height          =   4785
  92.       Left            =   1965
  93.       MouseIcon       =   "Treeview Listview Splitter.frx":0000
  94.       MousePointer    =   99  'Custom
  95.       Top             =   315
  96.       Width           =   150
  97.    End
  98. End
  99. Attribute VB_Name = "frmTreeviewListviewTemplate"
  100. Attribute VB_GlobalNameSpace = False
  101. Attribute VB_Creatable = False
  102. Attribute VB_PredeclaredId = True
  103. Attribute VB_Exposed = False
  104.  
  105. Const NAME_COLUMN = 0
  106. Const TYPE_COLUMN = 1
  107. Const SIZE_COLUMN = 2
  108. Const DATE_COLUMN = 3
  109.  
  110. Dim mbMoving As Boolean
  111. Const sglSplitLimit = 500
  112.  
  113.  
  114. Private Sub Form_Resize()
  115.   If Me.Width < 3000 Then Me.Width = 3000
  116.   SizeControls imgSplitter.Left
  117. End Sub
  118.  
  119. Private Sub imgSplitter_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  120.   With imgSplitter
  121.     picSplitter.Move .Left, .Top, .Width - 20, .Height - 20
  122.   End With
  123.   picSplitter.Visible = True
  124.   mbMoving = True
  125. End Sub
  126.  
  127. Private Sub imgSplitter_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  128.   Dim sglPos As Single
  129.   
  130.   If mbMoving Then
  131.     sglPos = X + imgSplitter.Left
  132.     If sglPos < sglSplitLimit Then
  133.       picSplitter.Left = sglSplitLimit
  134.     ElseIf sglPos > Me.Width - sglSplitLimit Then
  135.       picSplitter.Left = Me.Width - sglSplitLimit
  136.     Else
  137.       picSplitter.Left = sglPos
  138.     End If
  139.   End If
  140. End Sub
  141. Private Sub imgSplitter_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  142.   SizeControls picSplitter.Left
  143.   picSplitter.Visible = False
  144.   mbMoving = False
  145. End Sub
  146.  
  147. Sub SizeControls(X As Single)
  148.   On Error Resume Next
  149.   
  150.   'set the width
  151.   If X < 1500 Then X = 1500
  152.   If X > (Me.Width - 1500) Then X = Me.Width - 1500
  153.   tvTreeView.Width = X
  154.   imgSplitter.Left = X
  155.   lvListView.Left = X + 40
  156.   lvListView.Width = Me.Width - (tvTreeView.Width + 140)
  157.   lblTitle(0).Width = tvTreeView.Width
  158.   lblTitle(1).Left = lvListView.Left + 20
  159.   lblTitle(1).Width = lvListView.Width - 40
  160.  
  161.   'set the top
  162. '  If tbToolBar.Visible Then
  163. '    tvTreeView.Top = tbToolBar.Height + picTitles.Height
  164. '  Else
  165.     tvTreeView.Top = picTitles.Height
  166. '  End If
  167.   lvListView.Top = tvTreeView.Top
  168.   
  169.   'set the height
  170. '  If sbStatusBar.Visible Then
  171. '    tvTreeView.Height = Me.ScaleHeight - (picTitles.Top + picTitles.Height + sbStatusBar.Height)
  172. '  Else
  173.     tvTreeView.Height = Me.ScaleHeight - (picTitles.Top + picTitles.Height) ' + h)
  174. '  End If
  175.   
  176.   lvListView.Height = tvTreeView.Height
  177.   imgSplitter.Top = tvTreeView.Top
  178.   imgSplitter.Height = tvTreeView.Height
  179. End Sub
  180.  
  181. Private Sub tvTreeView_DragDrop(Source As Control, X As Single, Y As Single)
  182.   If Source = imgSplitter Then
  183.     SizeControls X
  184.   End If
  185. End Sub
  186.