home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD15887342001.psc / Form1.frm (.txt) next >
Encoding:
Visual Basic Form  |  2001-03-05  |  27.5 KB  |  769 lines

  1. VERSION 5.00
  2. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  3. Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"
  4. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  5. Begin VB.Form Form1 
  6.    BorderStyle     =   1  'Fixed Single
  7.    Caption         =   "VB Starter Kit Volume 2"
  8.    ClientHeight    =   7035
  9.    ClientLeft      =   45
  10.    ClientTop       =   390
  11.    ClientWidth     =   7110
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   7035
  16.    ScaleWidth      =   7110
  17.    StartUpPosition =   2  'CenterScreen
  18.    Begin VB.CommandButton Command4 
  19.       Caption         =   "About"
  20.       Height          =   375
  21.       Left            =   120
  22.       TabIndex        =   6
  23.       Top             =   6600
  24.       Width           =   1215
  25.    End
  26.    Begin VB.CommandButton Command3 
  27.       Caption         =   "Exit"
  28.       Height          =   375
  29.       Left            =   5760
  30.       TabIndex        =   5
  31.       Top             =   6600
  32.       Width           =   1215
  33.    End
  34.    Begin VB.CommandButton Command1 
  35.       Caption         =   "Copy"
  36.       Height          =   255
  37.       Left            =   5640
  38.       TabIndex        =   3
  39.       Top             =   4290
  40.       Width           =   1335
  41.    End
  42.    Begin RichTextLib.RichTextBox RTF 
  43.       Height          =   1935
  44.       Left            =   0
  45.       TabIndex        =   1
  46.       Top             =   4560
  47.       Width           =   7095
  48.       _ExtentX        =   12515
  49.       _ExtentY        =   3413
  50.       _Version        =   393217
  51.       ReadOnly        =   -1  'True
  52.       ScrollBars      =   3
  53.       RightMargin     =   2e6
  54.       TextRTF         =   $"Form1.frx":0000
  55.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  56.          Name            =   "Courier New"
  57.          Size            =   11.25
  58.          Charset         =   0
  59.          Weight          =   400
  60.          Underline       =   0   'False
  61.          Italic          =   0   'False
  62.          Strikethrough   =   0   'False
  63.       EndProperty
  64.    End
  65.    Begin TabDlg.SSTab SSTab1 
  66.       Height          =   4215
  67.       Left            =   0
  68.       TabIndex        =   0
  69.       Top             =   0
  70.       Width           =   7095
  71.       _ExtentX        =   12515
  72.       _ExtentY        =   7435
  73.       _Version        =   393216
  74.       Tabs            =   5
  75.       TabsPerRow      =   5
  76.       TabHeight       =   520
  77.       TabCaption(0)   =   "Listboxes"
  78.       TabPicture(0)   =   "Form1.frx":00C8
  79.       Tab(0).ControlEnabled=   -1  'True
  80.       Tab(0).Control(0)=   "Frame8"
  81.       Tab(0).Control(0).Enabled=   0   'False
  82.       Tab(0).ControlCount=   1
  83.       TabCaption(1)   =   "Scrollbars"
  84.       TabPicture(1)   =   "Form1.frx":00E4
  85.       Tab(1).ControlEnabled=   0   'False
  86.       Tab(1).Control(0)=   "Frame1"
  87.       Tab(1).ControlCount=   1
  88.       TabCaption(2)   =   "TreeViews"
  89.       TabPicture(2)   =   "Form1.frx":0100
  90.       Tab(2).ControlEnabled=   0   'False
  91.       Tab(2).Control(0)=   "Frame4"
  92.       Tab(2).ControlCount=   1
  93.       TabCaption(3)   =   "KeyCodes"
  94.       TabPicture(3)   =   "Form1.frx":011C
  95.       Tab(3).ControlEnabled=   0   'False
  96.       Tab(3).Control(0)=   "Frame2"
  97.       Tab(3).ControlCount=   1
  98.       TabCaption(4)   =   "Examples"
  99.       TabPicture(4)   =   "Form1.frx":0138
  100.       Tab(4).ControlEnabled=   0   'False
  101.       Tab(4).Control(0)=   "Frame7"
  102.       Tab(4).ControlCount=   1
  103.       Begin VB.Frame Frame2 
  104.          Height          =   3495
  105.          Left            =   -74760
  106.          TabIndex        =   10
  107.          Top             =   480
  108.          Width           =   6615
  109.          Begin VB.TextBox Text2 
  110.             BeginProperty Font 
  111.                Name            =   "MS Sans Serif"
  112.                Size            =   8.25
  113.                Charset         =   0
  114.                Weight          =   700
  115.                Underline       =   0   'False
  116.                Italic          =   0   'False
  117.                Strikethrough   =   0   'False
  118.             EndProperty
  119.             Height          =   285
  120.             Left            =   1680
  121.             MaxLength       =   1
  122.             TabIndex        =   34
  123.             Top             =   480
  124.             Width           =   375
  125.          End
  126.          Begin VB.Label Label10 
  127.             Caption         =   $"Form1.frx":0154
  128.             Height          =   1815
  129.             Left            =   360
  130.             TabIndex        =   40
  131.             Top             =   1440
  132.             Width           =   5895
  133.          End
  134.          Begin VB.Line Line1 
  135.             X1              =   360
  136.             X2              =   6360
  137.             Y1              =   1080
  138.             Y2              =   1080
  139.          End
  140.          Begin VB.Line Line2 
  141.             BorderColor     =   &H80000009&
  142.             X1              =   360
  143.             X2              =   6360
  144.             Y1              =   1095
  145.             Y2              =   1095
  146.          End
  147.          Begin VB.Label Label9 
  148.             AutoSize        =   -1  'True
  149.             Caption         =   "ASCII ="
  150.             Height          =   195
  151.             Left            =   2280
  152.             TabIndex        =   39
  153.             Top             =   540
  154.             Width           =   540
  155.          End
  156.          Begin VB.Label lblASCII 
  157.             Alignment       =   2  'Center
  158.             BorderStyle     =   1  'Fixed Single
  159.             ForeColor       =   &H00C00000&
  160.             Height          =   285
  161.             Left            =   3000
  162.             TabIndex        =   38
  163.             Top             =   480
  164.             Width           =   735
  165.          End
  166.          Begin VB.Label Label8 
  167.             AutoSize        =   -1  'True
  168.             Caption         =   "Shift ="
  169.             Height          =   195
  170.             Left            =   4200
  171.             TabIndex        =   37
  172.             Top             =   540
  173.             Width           =   450
  174.          End
  175.          Begin VB.Label lblShift 
  176.             Alignment       =   2  'Center
  177.             BorderStyle     =   1  'Fixed Single
  178.             ForeColor       =   &H00C00000&
  179.             Height          =   285
  180.             Left            =   4800
  181.             TabIndex        =   36
  182.             Top             =   480
  183.             Width           =   735
  184.          End
  185.          Begin VB.Label Label7 
  186.             Caption         =   "Enter Character"
  187.             Height          =   255
  188.             Left            =   360
  189.             TabIndex        =   35
  190.             Top             =   540
  191.             Width           =   1215
  192.          End
  193.       End
  194.       Begin VB.Frame Frame1 
  195.          Height          =   3495
  196.          Left            =   -74760
  197.          TabIndex        =   9
  198.          Top             =   480
  199.          Width           =   6615
  200.          Begin VB.VScrollBar VScroll1 
  201.             Height          =   2295
  202.             Left            =   3960
  203.             TabIndex        =   24
  204.             Top             =   600
  205.             Width           =   255
  206.          End
  207.          Begin VB.HScrollBar HScroll1 
  208.             Height          =   255
  209.             Left            =   480
  210.             TabIndex        =   23
  211.             Top             =   3000
  212.             Width           =   3375
  213.          End
  214.          Begin VB.PictureBox Picture1 
  215.             Height          =   2295
  216.             Left            =   480
  217.             ScaleHeight     =   2235
  218.             ScaleWidth      =   3315
  219.             TabIndex        =   21
  220.             Top             =   600
  221.             Width           =   3375
  222.             Begin RichTextLib.RichTextBox RichTextBox1 
  223.                Height          =   10000
  224.                Left            =   0
  225.                TabIndex        =   22
  226.                Top             =   0
  227.                Width           =   10000
  228.                _ExtentX        =   17648
  229.                _ExtentY        =   17648
  230.                _Version        =   393217
  231.                Enabled         =   -1  'True
  232.                Appearance      =   0
  233.                TextRTF         =   $"Form1.frx":0316
  234.                BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  235.                   Name            =   "MS Sans Serif"
  236.                   Size            =   18
  237.                   Charset         =   0
  238.                   Weight          =   400
  239.                   Underline       =   0   'False
  240.                   Italic          =   0   'False
  241.                   Strikethrough   =   0   'False
  242.                EndProperty
  243.             End
  244.          End
  245.          Begin VB.Label Label4 
  246.             Caption         =   $"Form1.frx":03DE
  247.             Height          =   2295
  248.             Left            =   4440
  249.             TabIndex        =   25
  250.             Top             =   600
  251.             Width           =   1935
  252.          End
  253.       End
  254.       Begin VB.Frame Frame8 
  255.          Height          =   3495
  256.          Left            =   240
  257.          TabIndex        =   8
  258.          Top             =   480
  259.          Width           =   6615
  260.          Begin VB.TextBox Text1 
  261.             Height          =   285
  262.             Left            =   4200
  263.             TabIndex        =   18
  264.             Top             =   480
  265.             Width           =   2175
  266.          End
  267.          Begin VB.CommandButton cmdList 
  268.             Caption         =   "Reset"
  269.             Height          =   375
  270.             Index           =   5
  271.             Left            =   2400
  272.             TabIndex        =   17
  273.             Top             =   2880
  274.             Width           =   1575
  275.          End
  276.          Begin VB.CommandButton cmdList 
  277.             Caption         =   "Remove Dupes"
  278.             Height          =   375
  279.             Index           =   4
  280.             Left            =   2400
  281.             TabIndex        =   16
  282.             Top             =   2400
  283.             Width           =   1575
  284.          End
  285.          Begin VB.CommandButton cmdList 
  286.             Caption         =   "Move Down"
  287.             Height          =   375
  288.             Index           =   3
  289.             Left            =   2400
  290.             TabIndex        =   15
  291.             Top             =   1920
  292.             Width           =   1575
  293.          End
  294.          Begin VB.CommandButton cmdList 
  295.             Caption         =   "Move Up"
  296.             Height          =   375
  297.             Index           =   2
  298.             Left            =   2400
  299.             TabIndex        =   14
  300.             Top             =   1440
  301.             Width           =   1575
  302.          End
  303.          Begin VB.CommandButton cmdList 
  304.             Caption         =   "Remove"
  305.             Height          =   375
  306.             Index           =   1
  307.             Left            =   2400
  308.             TabIndex        =   13
  309.             Top             =   960
  310.             Width           =   1575
  311.          End
  312.          Begin VB.CommandButton cmdList 
  313.             Caption         =   "Add Item"
  314.             Enabled         =   0   'False
  315.             Height          =   375
  316.             Index           =   0
  317.             Left            =   2400
  318.             TabIndex        =   12
  319.             Top             =   480
  320.             Width           =   1575
  321.          End
  322.          Begin VB.ListBox List1 
  323.             Height          =   2790
  324.             ItemData        =   "Form1.frx":049C
  325.             Left            =   360
  326.             List            =   "Form1.frx":049E
  327.             TabIndex        =   11
  328.             Top             =   480
  329.             Width           =   1815
  330.          End
  331.          Begin VB.Label Label3 
  332.             Caption         =   "The Listbox is one of the most simple controls but is also one of the most useful."
  333.             Height          =   2175
  334.             Left            =   4200
  335.             TabIndex        =   20
  336.             Top             =   960
  337.             Width           =   2175
  338.          End
  339.          Begin VB.Label Label1 
  340.             Caption         =   "Item to Add :"
  341.             Height          =   255
  342.             Left            =   4200
  343.             TabIndex        =   19
  344.             Top             =   240
  345.             Width           =   1335
  346.          End
  347.       End
  348.       Begin VB.Frame Frame7 
  349.          Height          =   3495
  350.          Left            =   -74760
  351.          TabIndex        =   7
  352.          Top             =   480
  353.          Width           =   6615
  354.          Begin VB.CommandButton Command5 
  355.             Caption         =   "Picture Resizer"
  356.             Height          =   375
  357.             Left            =   480
  358.             TabIndex        =   43
  359.             Top             =   1800
  360.             Width           =   2175
  361.          End
  362.          Begin VB.CommandButton Command2 
  363.             Caption         =   "Random Mouse Mover"
  364.             Height          =   375
  365.             Left            =   480
  366.             TabIndex        =   41
  367.             Top             =   600
  368.             Width           =   2175
  369.          End
  370.          Begin VB.Label Label12 
  371.             Caption         =   "Resize a Picture correctly so you can save as a smaller picture."
  372.             Height          =   375
  373.             Left            =   2880
  374.             TabIndex        =   44
  375.             Top             =   1800
  376.             Width           =   3375
  377.          End
  378.          Begin VB.Label Label11 
  379.             Caption         =   "Press Ctl Q to stop - This example shows control of the cursor pos and registering Hotkeys."
  380.             Height          =   495
  381.             Left            =   2880
  382.             TabIndex        =   42
  383.             Top             =   600
  384.             Width           =   3495
  385.          End
  386.       End
  387.       Begin VB.Frame Frame4 
  388.          Height          =   3495
  389.          Left            =   -74760
  390.          TabIndex        =   4
  391.          Top             =   480
  392.          Width           =   6615
  393.          Begin VB.CommandButton cmdTV 
  394.             Caption         =   "Rename"
  395.             Enabled         =   0   'False
  396.             Height          =   375
  397.             Index           =   4
  398.             Left            =   4800
  399.             TabIndex        =   32
  400.             Top             =   2400
  401.             Width           =   1455
  402.          End
  403.          Begin VB.CommandButton cmdTV 
  404.             Caption         =   "Delete"
  405.             Enabled         =   0   'False
  406.             Height          =   375
  407.             Index           =   3
  408.             Left            =   3000
  409.             TabIndex        =   29
  410.             Top             =   2400
  411.             Width           =   1455
  412.          End
  413.          Begin VB.CommandButton cmdTV 
  414.             Caption         =   "Add PSC Link"
  415.             Enabled         =   0   'False
  416.             Height          =   375
  417.             Index           =   2
  418.             Left            =   3000
  419.             TabIndex        =   28
  420.             Top             =   1920
  421.             Width           =   1455
  422.          End
  423.          Begin VB.CommandButton cmdTV 
  424.             Caption         =   "Add Folder"
  425.             Enabled         =   0   'False
  426.             Height          =   375
  427.             Index           =   1
  428.             Left            =   4800
  429.             TabIndex        =   27
  430.             Top             =   1920
  431.             Width           =   1455
  432.          End
  433.          Begin VB.CommandButton cmdTV 
  434.             Caption         =   "Load Favorites"
  435.             Height          =   375
  436.             Index           =   0
  437.             Left            =   3000
  438.             TabIndex        =   26
  439.             Top             =   1440
  440.             Width           =   1935
  441.          End
  442.          Begin MSComctlLib.ImageList ImageList1 
  443.             Left            =   5280
  444.             Top             =   1440
  445.             _ExtentX        =   1005
  446.             _ExtentY        =   1005
  447.             BackColor       =   -2147483643
  448.             ImageWidth      =   16
  449.             ImageHeight     =   16
  450.             MaskColor       =   12632256
  451.             _Version        =   393216
  452.             BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  453.                NumListImages   =   6
  454.                BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  455.                   Picture         =   "Form1.frx":04A0
  456.                   Key             =   ""
  457.                EndProperty
  458.                BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  459.                   Picture         =   "Form1.frx":0A3A
  460.                   Key             =   ""
  461.                EndProperty
  462.                BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  463.                   Picture         =   "Form1.frx":0FD4
  464.                   Key             =   ""
  465.                EndProperty
  466.                BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  467.                   Picture         =   "Form1.frx":3788
  468.                   Key             =   ""
  469.                EndProperty
  470.                BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  471.                   Picture         =   "Form1.frx":5F3C
  472.                   Key             =   "Add"
  473.                EndProperty
  474.                BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  475.                   Picture         =   "Form1.frx":64D8
  476.                   Key             =   "Organise"
  477.                EndProperty
  478.             EndProperty
  479.          End
  480.          Begin MSComctlLib.TreeView TreeView1 
  481.             Height          =   2535
  482.             Left            =   240
  483.             TabIndex        =   31
  484.             Top             =   360
  485.             Width           =   2535
  486.             _ExtentX        =   4471
  487.             _ExtentY        =   4471
  488.             _Version        =   393217
  489.             HideSelection   =   0   'False
  490.             Indentation     =   441
  491.             LabelEdit       =   1
  492.             Style           =   1
  493.             HotTracking     =   -1  'True
  494.             ImageList       =   "ImageList1"
  495.             Appearance      =   1
  496.          End
  497.          Begin VB.Label Label6 
  498.             Height          =   255
  499.             Left            =   240
  500.             TabIndex        =   33
  501.             Top             =   3000
  502.             Width           =   6135
  503.          End
  504.          Begin VB.Label Label5 
  505.             Caption         =   $"Form1.frx":6A74
  506.             Height          =   975
  507.             Left            =   3000
  508.             TabIndex        =   30
  509.             Top             =   360
  510.             Width           =   3375
  511.          End
  512.       End
  513.    End
  514.    Begin VB.Label Label2 
  515.       Caption         =   "Code :"
  516.       Height          =   255
  517.       Left            =   120
  518.       TabIndex        =   2
  519.       Top             =   4320
  520.       Width           =   1575
  521.    End
  522. Attribute VB_Name = "Form1"
  523. Attribute VB_GlobalNameSpace = False
  524. Attribute VB_Creatable = False
  525. Attribute VB_PredeclaredId = True
  526. Attribute VB_Exposed = False
  527. Dim sfile As String
  528. Dim beforerename As String
  529. Dim renameroot As String
  530. Dim ImAdir As Boolean
  531. Dim mShift As Integer
  532. Dim mAscii As Integer
  533. Private Sub cmdList_Click(Index As Integer)
  534. Dim ListPos As Long, ListPos2 As Long
  535. Dim nItem As Integer
  536. LockWindowUpdate List1.hWnd
  537. Select Case Index
  538.     Case 0
  539.         If Text1.Text <> "" Then List1.AddItem Text1.Text
  540.         List1.Selected(List1.ListCount - 1) = True
  541.         RTF.Text = "If Text1.Text <> " + Chr(34) + Chr(34) + " Then List1.AddItem Text1.Text" + vbCrLf + _
  542.         "List1.Selected(List1.ListCount - 1) = True"
  543.     Case 1
  544.         If List1.ListIndex > 0 Then
  545.             nItem = List1.ListIndex - 1
  546.         Else
  547.             nItem = 0
  548.         End If
  549.         List1.RemoveItem List1.ListIndex
  550.         If List1.ListCount > 0 Then List1.Selected(nItem) = True
  551.         RTF.Text = "List1.RemoveItem List1.ListIndex"
  552.     Case 2
  553.         With List1
  554.           If .ListIndex < 0 Then Exit Sub
  555.           nItem = .ListIndex
  556.           If nItem = 0 Then Exit Sub
  557.           .AddItem .Text, nItem - 1
  558.           .RemoveItem nItem + 1
  559.           .Selected(nItem - 1) = True
  560.         End With
  561.         RTF.Text = "With List1" + vbCrLf + _
  562.         "  If .ListIndex < 0 Then Exit Sub" + vbCrLf + _
  563.         "  nItem = .ListIndex" + vbCrLf + _
  564.         "  If nItem = 0 Then Exit Sub" + vbCrLf + _
  565.         "  .AddItem .Text, nItem - 1" + vbCrLf + _
  566.         "  .RemoveItem nItem + 1" + vbCrLf + _
  567.         "  .Selected(nItem - 1) = True" + vbCrLf + _
  568.         "End With"
  569.     Case 3
  570.         With List1
  571.           If .ListIndex < 0 Then Exit Sub
  572.           nItem = .ListIndex
  573.           If nItem = .ListCount - 1 Then Exit Sub
  574.           .AddItem .Text, nItem + 2
  575.           .RemoveItem nItem
  576.           .Selected(nItem + 1) = True
  577.         End With
  578.         RTF.Text = "With List1" + vbCrLf + _
  579.         "  If .ListIndex < 0 Then Exit Sub" + vbCrLf + _
  580.         "  nItem = .ListIndex" + vbCrLf + _
  581.         "  If nItem = .ListCount - 1 Then Exit Sub" + vbCrLf + _
  582.         "  .AddItem .Text, nItem + 2" + vbCrLf + _
  583.         "  .RemoveItem nItem" + vbCrLf + _
  584.         "  .Selected(nItem + 1) = True" + vbCrLf + _
  585.         "End With"
  586.     Case 4
  587.         For x = 0 To List1.ListCount - 1
  588.             For y = 0 To List1.ListCount - 1
  589.                 ListPos = SendMessageByString(List1.hWnd, LB_FINDSTRINGEXACT, 0, List1.List(x))
  590.                 If ListPos <> x And ListPos <> -1 Then List1.RemoveItem ListPos
  591.             Next y
  592.         Next x
  593.         RTF.Text = "For x = 0 To List1.ListCount - 1" + vbCrLf + _
  594.         "    For y = 0 To List1.ListCount - 1" + vbCrLf + _
  595.         "        ListPos = SendMessageByString(List1.hwnd, LB_FINDSTRINGEXACT, 0, List1.List(x))" + vbCrLf + _
  596.         "        If ListPos <> x And ListPos <> -1 Then List1.RemoveItem ListPos" + vbCrLf + _
  597.         "    Next y" + vbCrLf + _
  598.         "Next x"
  599.     Case 5
  600.         ReloadList
  601. End Select
  602. LockWindowUpdate 0
  603. End Sub
  604. Private Sub cmdTV_Click(Index As Integer)
  605. Select Case Index
  606.     Case 0
  607.         If TreeFilled = False Then FillTree TreeView1
  608.         cmdTV(0).Enabled = False
  609.         cmdTV(1).Enabled = True
  610.         cmdTV(2).Enabled = True
  611.         cmdTV(3).Enabled = True
  612.         cmdTV(4).Enabled = True
  613.     Case 1
  614.         NewFolder TreeView1
  615.     Case 2
  616.         AddLink TreeView1
  617.     Case 3
  618.         DeleteLink TreeView1
  619.     Case 4
  620.         If TreeView1.SelectedItem.Key <> SpecialFolder(6) + "\" Then TreeView1.StartLabelEdit
  621. End Select
  622. End Sub
  623. Private Sub Command1_Click()
  624. Clipboard.Clear
  625. Clipboard.SetText RTF.Text
  626. End Sub
  627. Private Sub Command2_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
  628. frmCrazy.letsGo
  629. End Sub
  630. Private Sub Command3_Click()
  631. Unload Me
  632. End Sub
  633. Private Sub Command4_Click()
  634. Form2.Show vbModal
  635. End Sub
  636. Private Sub Command5_Click()
  637. frmResizer.Show
  638. End Sub
  639. Private Sub Form_Load()
  640. ReloadList
  641. VScroll1.Max = RichTextBox1.Height - Picture1.Height
  642. HScroll1.Max = RichTextBox1.Width - Picture1.Width
  643. RichTextBox1.Text = "This RichTextbox width and height properties are set" + vbCrLf + "to 10000. It has no scrollbars set (Scrollbars = 0)" + vbCrLf + "" + vbCrLf + "" + vbCrLf + "" + vbCrLf + "" + vbCrLf + "" + vbCrLf + "" + vbCrLf + "" + vbCrLf + "" + vbCrLf + "" + vbCrLf + "" + vbCrLf + "" + vbCrLf + "See, you can use your own scrollbars to control the position of any control"
  644. End Sub
  645. Private Sub Form_Unload(Cancel As Integer)
  646. Unload Form2
  647. End Sub
  648. Public Sub ReloadList()
  649. List1.Clear
  650. For x = 0 To 19
  651.     List1.AddItem "Listitem" + Trim(Str(x + 1))
  652. Next x
  653. For x = 0 To 19 Step 2
  654.     List1.AddItem "Listitem" + Trim(Str(x + 1))
  655. Next x
  656. List1.Selected(0) = True
  657. End Sub
  658. Private Sub HScroll1_Change()
  659.     RichTextBox1.Left = -HScroll1.Value
  660. End Sub
  661. Private Sub HScroll1_Scroll()
  662.     RichTextBox1.Left = -HScroll1.Value
  663. End Sub
  664. Private Sub SSTab1_Click(PreviousTab As Integer)
  665. Select Case SSTab1.Tab
  666.     Case 1
  667.         RTF.Text = "'Assumes a Picturebox(Picture1), a RichTextbox(RichTextBox1) and a vertical(VScroll1) and horizontal(HScroll1) scrollbar" + vbCrLf + _
  668.         "Private Sub Form_Load()" + vbCrLf + _
  669.         "    VScroll1.Max = RichTextBox1.Height - Picture1.Height" + vbCrLf + _
  670.         "    HScroll1.Max = RichTextBox1.Width - Picture1.Width" + vbCrLf + _
  671.         "End Sub" + vbCrLf + vbCrLf + _
  672.         "Private Sub HScroll1_Change()" + vbCrLf + _
  673.         "    RichTextBox1.Left = -HScroll1.Value" + vbCrLf + _
  674.         "End Sub" + vbCrLf + vbCrLf + _
  675.         "Private Sub HScroll1_Scroll()" + vbCrLf + _
  676.         "    RichTextBox1.Left = -HScroll1.Value" + vbCrLf + _
  677.         "End Sub" + vbCrLf + vbCrLf + _
  678.         "Private Sub VScroll1_Change()" + vbCrLf + _
  679.         "    RichTextBox1.Top = -VScroll1.Value" + vbCrLf + _
  680.         "End Sub" + vbCrLf + vbCrLf + _
  681.         "Private Sub VScroll1_Scroll()" + vbCrLf + _
  682.         "    RichTextBox1.Top = -VScroll1.Value" + vbCrLf + _
  683.         "End Sub"
  684.     Case 2
  685.         RTF.Text = "Most of the code for the Treeview is found" + vbCrLf + _
  686.         "in the module ModTV. It also calls functions" + vbCrLf + _
  687.         "in ModGP. Use these functions in conjunction" + vbCrLf + _
  688.         "with the Treeview1 entries on Form1."
  689.     Case 3
  690.         Text2.SetFocus
  691.         RTF.Text = "Private Sub Text2_KeyPress(KeyAscii As Integer)" + vbCrLf + _
  692.         "    mAscii = KeyAscii" + vbCrLf + _
  693.         "End Sub"
  694.     Case Else
  695.         RTF.Text = ""
  696. End Select
  697. End Sub
  698. Private Sub Text1_Change()
  699. If Len(Text1.Text) > 0 Then
  700.     cmdList(0).Enabled = True
  701.     cmdList(0).Enabled = False
  702. End If
  703. End Sub
  704. Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
  705. Text2.SelStart = 0
  706. Text2.SelLength = 1
  707. mShift = Shift
  708. End Sub
  709. Private Sub Text2_KeyPress(KeyAscii As Integer)
  710. mAscii = KeyAscii
  711. End Sub
  712. Private Sub Text2_KeyUp(KeyCode As Integer, Shift As Integer)
  713. lblASCII = mAscii
  714. lblShift = mShift
  715. End Sub
  716. Private Sub TreeView1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  717. Dim temp As String
  718. Set fred = TreeView1.HitTest(x, y)
  719. If fred Is Nothing Then Exit Sub
  720. Set LastSelected = fred
  721. End Sub
  722. Private Sub TreeView1_AfterLabelEdit(Cancel As Integer, NewString As String)
  723. If ImAdir = False Then 'ImAdir variable was set in the sub TreeView1_BeforeLabelEdit
  724.     If FileExists(beforerename + ".url") Then
  725.         temp = SafeSave(renameroot + NewString + ".url")
  726.         NewString = ChangeExt(safesavename)
  727.         Name beforerename + ".url" As temp
  728.         TreeView1.SelectedItem.Key = temp
  729.     End If
  730.     If FileExists(beforerename) Then
  731.         temp = SafeSave(renameroot + NewString)
  732.         NewString = safesavename
  733.         Name beforerename As temp
  734.         TreeView1.SelectedItem.Key = temp + "\"
  735.     End If
  736. End If
  737. dontselect = False
  738. End Sub
  739. Private Sub TreeView1_BeforeLabelEdit(Cancel As Integer)
  740. dontselect = True
  741. If TreeView1.SelectedItem.Key = "IE" Then
  742. Cancel = 1
  743. Exit Sub
  744. End If
  745. If Right(TreeView1.SelectedItem.Key, 1) = "\" Then
  746.     ImAdir = True
  747.     ImAdir = False
  748. End If
  749. For x = 1 To TreeView1.Nodes.Count
  750.     If TreeView1.Nodes.Item(x).Selected = True Then
  751.         beforerename = SpecialFolder(6) + "\" + Right(TreeView1.Nodes.Item(x).FullPath, Len(TreeView1.Nodes.Item(x).FullPath) - 10)
  752.         renameroot = Left(beforerename, Len(beforerename) - Len(TreeView1.Nodes.Item(x).Text))
  753.         Exit For
  754.     End If
  755. Next x
  756. End Sub
  757. Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
  758. Dim temp As String
  759. temp = Node.Key
  760. If Right(temp, 1) = "\" Or temp = "IE" Then Exit Sub
  761. Label6 = ReadINI(temp, "InternetShortcut", "URL")
  762. End Sub
  763. Private Sub VScroll1_Change()
  764.     RichTextBox1.Top = -VScroll1.Value
  765. End Sub
  766. Private Sub VScroll1_Scroll()
  767.     RichTextBox1.Top = -VScroll1.Value
  768. End Sub
  769.