home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / cursors / cursor.frm < prev    next >
Text File  |  1993-09-05  |  14KB  |  467 lines

  1. VERSION 2.00
  2. Begin Form CursorDemo 
  3.    Caption         =   "VB Custom Cursor Demo"
  4.    ClientHeight    =   5070
  5.    ClientLeft      =   1380
  6.    ClientTop       =   900
  7.    ClientWidth     =   7035
  8.    Height          =   5475
  9.    Icon            =   CURSOR.FRX:0000
  10.    Left            =   1320
  11.    LinkTopic       =   "Form3"
  12.    ScaleHeight     =   5070
  13.    ScaleWidth      =   7035
  14.    Top             =   555
  15.    Width           =   7155
  16.    Begin PictureBox picCursorMask6 
  17.       Height          =   510
  18.       Left            =   3060
  19.       Picture         =   CURSOR.FRX:0302
  20.       ScaleHeight     =   32
  21.       ScaleMode       =   3  'Pixel
  22.       ScaleWidth      =   32
  23.       TabIndex        =   36
  24.       Top             =   4140
  25.       Width           =   510
  26.    End
  27.    Begin PictureBox picCursor6 
  28.       AutoRedraw      =   -1  'True
  29.       Height          =   510
  30.       Left            =   3060
  31.       Picture         =   CURSOR.FRX:0604
  32.       ScaleHeight     =   32
  33.       ScaleMode       =   3  'Pixel
  34.       ScaleWidth      =   32
  35.       TabIndex        =   34
  36.       Top             =   3360
  37.       Width           =   510
  38.    End
  39.    Begin PictureBox picCursorMask5 
  40.       Height          =   510
  41.       Left            =   2580
  42.       Picture         =   CURSOR.FRX:0906
  43.       ScaleHeight     =   32
  44.       ScaleMode       =   3  'Pixel
  45.       ScaleWidth      =   32
  46.       TabIndex        =   33
  47.       Top             =   4140
  48.       Width           =   510
  49.    End
  50.    Begin PictureBox picCursor5 
  51.       AutoRedraw      =   -1  'True
  52.       Height          =   510
  53.       Left            =   2580
  54.       Picture         =   CURSOR.FRX:0C08
  55.       ScaleHeight     =   32
  56.       ScaleMode       =   3  'Pixel
  57.       ScaleWidth      =   32
  58.       TabIndex        =   31
  59.       Top             =   3360
  60.       Width           =   510
  61.    End
  62.    Begin PictureBox picCursorMask0 
  63.       Height          =   510
  64.       Left            =   180
  65.       Picture         =   CURSOR.FRX:0F0A
  66.       ScaleHeight     =   32
  67.       ScaleMode       =   3  'Pixel
  68.       ScaleWidth      =   32
  69.       TabIndex        =   29
  70.       Top             =   4140
  71.       Width           =   510
  72.    End
  73.    Begin PictureBox picCursor0 
  74.       AutoRedraw      =   -1  'True
  75.       Height          =   510
  76.       Left            =   180
  77.       Picture         =   CURSOR.FRX:120C
  78.       ScaleHeight     =   32
  79.       ScaleMode       =   3  'Pixel
  80.       ScaleWidth      =   32
  81.       TabIndex        =   28
  82.       Top             =   3360
  83.       Width           =   510
  84.    End
  85.    Begin OptionButton Option1 
  86.       Caption         =   "Option1"
  87.       Height          =   315
  88.       Left            =   4080
  89.       TabIndex        =   18
  90.       Top             =   3300
  91.       Value           =   -1  'True
  92.       Width           =   1035
  93.    End
  94.    Begin OptionButton Option2 
  95.       Caption         =   "Option2"
  96.       Height          =   315
  97.       Left            =   4080
  98.       TabIndex        =   17
  99.       Top             =   3600
  100.       Width           =   1035
  101.    End
  102.    Begin VScrollBar VScroll2 
  103.       Height          =   1335
  104.       Left            =   1380
  105.       TabIndex        =   16
  106.       Top             =   1260
  107.       Width           =   255
  108.    End
  109.    Begin VScrollBar VScroll1 
  110.       Height          =   1335
  111.       Left            =   480
  112.       TabIndex        =   15
  113.       Top             =   1260
  114.       Width           =   255
  115.    End
  116.    Begin CommandButton Command1 
  117.       Caption         =   "Command1"
  118.       Height          =   495
  119.       Left            =   5640
  120.       TabIndex        =   14
  121.       Top             =   3480
  122.       Width           =   1215
  123.    End
  124.    Begin PictureBox picCursorMask4 
  125.       Height          =   510
  126.       Left            =   2100
  127.       Picture         =   CURSOR.FRX:150E
  128.       ScaleHeight     =   32
  129.       ScaleMode       =   3  'Pixel
  130.       ScaleWidth      =   32
  131.       TabIndex        =   13
  132.       Top             =   4140
  133.       Width           =   510
  134.    End
  135.    Begin PictureBox picCursorMask3 
  136.       Height          =   510
  137.       Left            =   1620
  138.       Picture         =   CURSOR.FRX:1810
  139.       ScaleHeight     =   32
  140.       ScaleMode       =   3  'Pixel
  141.       ScaleWidth      =   32
  142.       TabIndex        =   12
  143.       Top             =   4140
  144.       Width           =   510
  145.    End
  146.    Begin PictureBox picCursor4 
  147.       AutoRedraw      =   -1  'True
  148.       Height          =   510
  149.       Left            =   2100
  150.       Picture         =   CURSOR.FRX:1B12
  151.       ScaleHeight     =   32
  152.       ScaleMode       =   3  'Pixel
  153.       ScaleWidth      =   32
  154.       TabIndex        =   11
  155.       Top             =   3360
  156.       Width           =   510
  157.    End
  158.    Begin PictureBox picCursor3 
  159.       AutoRedraw      =   -1  'True
  160.       Height          =   510
  161.       Left            =   1620
  162.       Picture         =   CURSOR.FRX:1E14
  163.       ScaleHeight     =   32
  164.       ScaleMode       =   3  'Pixel
  165.       ScaleWidth      =   32
  166.       TabIndex        =   10
  167.       Top             =   3360
  168.       Width           =   510
  169.    End
  170.    Begin PictureBox picCursorMask2 
  171.       Height          =   510
  172.       Left            =   1140
  173.       Picture         =   CURSOR.FRX:2116
  174.       ScaleHeight     =   32
  175.       ScaleMode       =   3  'Pixel
  176.       ScaleWidth      =   32
  177.       TabIndex        =   7
  178.       Top             =   4140
  179.       Width           =   510
  180.    End
  181.    Begin PictureBox picCursor2 
  182.       AutoRedraw      =   -1  'True
  183.       Height          =   510
  184.       Left            =   1140
  185.       Picture         =   CURSOR.FRX:2418
  186.       ScaleHeight     =   32
  187.       ScaleMode       =   3  'Pixel
  188.       ScaleWidth      =   32
  189.       TabIndex        =   6
  190.       Top             =   3360
  191.       Width           =   510
  192.    End
  193.    Begin TextBox Text2 
  194.       Height          =   1335
  195.       Left            =   3900
  196.       MultiLine       =   -1  'True
  197.       TabIndex        =   5
  198.       Text            =   "x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x"
  199.       Top             =   1320
  200.       Width           =   1275
  201.    End
  202.    Begin PictureBox picCursorMask1 
  203.       Height          =   510
  204.       Left            =   660
  205.       Picture         =   CURSOR.FRX:271A
  206.       ScaleHeight     =   32
  207.       ScaleMode       =   3  'Pixel
  208.       ScaleWidth      =   32
  209.       TabIndex        =   4
  210.       Top             =   4140
  211.       Width           =   510
  212.    End
  213.    Begin PictureBox picCursor1 
  214.       AutoRedraw      =   -1  'True
  215.       Height          =   510
  216.       Left            =   660
  217.       Picture         =   CURSOR.FRX:2A1C
  218.       ScaleHeight     =   32
  219.       ScaleMode       =   3  'Pixel
  220.       ScaleWidth      =   32
  221.       TabIndex        =   3
  222.       Top             =   3360
  223.       Width           =   510
  224.    End
  225.    Begin CommandButton cmdExit 
  226.       Caption         =   "E&xit"
  227.       Height          =   495
  228.       Left            =   5640
  229.       TabIndex        =   2
  230.       Top             =   4080
  231.       Width           =   1215
  232.    End
  233.    Begin TextBox Text1 
  234.       Height          =   1335
  235.       Left            =   2400
  236.       MousePointer    =   3  'I-Beam
  237.       MultiLine       =   -1  'True
  238.       TabIndex        =   0
  239.       Text            =   "x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x"
  240.       Top             =   1320
  241.       Width           =   1275
  242.    End
  243.    Begin Label Label10 
  244.       Caption         =   "Image1"
  245.       Height          =   195
  246.       Left            =   5820
  247.       TabIndex        =   38
  248.       Top             =   2220
  249.       Width           =   630
  250.    End
  251.    Begin Image Image1 
  252.       Height          =   480
  253.       Left            =   5880
  254.       Picture         =   CURSOR.FRX:2D1E
  255.       Top             =   2520
  256.       Width           =   480
  257.    End
  258.    Begin Label Label1 
  259.       BorderStyle     =   1  'Fixed Single
  260.       Caption         =   "Label1"
  261.       Height          =   495
  262.       Left            =   5580
  263.       TabIndex        =   37
  264.       Top             =   1320
  265.       Width           =   1215
  266.    End
  267.    Begin Label Label9 
  268.       Alignment       =   2  'Center
  269.       Caption         =   "6"
  270.       Height          =   195
  271.       Index           =   6
  272.       Left            =   3180
  273.       TabIndex        =   35
  274.       Top             =   3900
  275.       Width           =   240
  276.    End
  277.    Begin Label Label9 
  278.       Alignment       =   2  'Center
  279.       Caption         =   "5"
  280.       Height          =   195
  281.       Index           =   5
  282.       Left            =   2700
  283.       TabIndex        =   32
  284.       Top             =   3900
  285.       Width           =   240
  286.    End
  287.    Begin Label Label9 
  288.       Alignment       =   2  'Center
  289.       Caption         =   "4"
  290.       Height          =   195
  291.       Index           =   4
  292.       Left            =   2220
  293.       TabIndex        =   30
  294.       Top             =   3900
  295.       Width           =   240
  296.    End
  297.    Begin Label Label9 
  298.       Alignment       =   2  'Center
  299.       Caption         =   "3"
  300.       Height          =   195
  301.       Index           =   3
  302.       Left            =   1740
  303.       TabIndex        =   27
  304.       Top             =   3900
  305.       Width           =   240
  306.    End
  307.    Begin Label Label9 
  308.       Alignment       =   2  'Center
  309.       Caption         =   "2"
  310.       Height          =   195
  311.       Index           =   2
  312.       Left            =   1260
  313.       TabIndex        =   26
  314.       Top             =   3900
  315.       Width           =   240
  316.    End
  317.    Begin Label Label9 
  318.       Alignment       =   2  'Center
  319.       Caption         =   "1"
  320.       Height          =   195
  321.       Index           =   1
  322.       Left            =   780
  323.       TabIndex        =   25
  324.       Top             =   3900
  325.       Width           =   240
  326.    End
  327.    Begin Label Label9 
  328.       Alignment       =   2  'Center
  329.       Caption         =   "0"
  330.       Height          =   195
  331.       Index           =   0
  332.       Left            =   300
  333.       TabIndex        =   24
  334.       Top             =   3900
  335.       Width           =   240
  336.    End
  337.    Begin Label Label8 
  338.       Caption         =   "cmdExit"
  339.       Height          =   195
  340.       Left            =   5940
  341.       TabIndex        =   23
  342.       Top             =   4620
  343.       Width           =   675
  344.    End
  345.    Begin Label Label7 
  346.       Caption         =   "Text2"
  347.       Height          =   195
  348.       Left            =   4260
  349.       TabIndex        =   22
  350.       Top             =   1020
  351.       Width           =   495
  352.    End
  353.    Begin Label Label6 
  354.       Caption         =   "Text1"
  355.       Height          =   195
  356.       Left            =   2760
  357.       TabIndex        =   21
  358.       Top             =   1020
  359.       Width           =   495
  360.    End
  361.    Begin Label Label4 
  362.       Caption         =   "VScroll2"
  363.       Height          =   195
  364.       Left            =   1140
  365.       TabIndex        =   20
  366.       Top             =   960
  367.       Width           =   720
  368.    End
  369.    Begin Label Label11 
  370.       Caption         =   "VScroll1"
  371.       Height          =   195
  372.       Left            =   240
  373.       TabIndex        =   19
  374.       Top             =   960
  375.       Width           =   720
  376.    End
  377.    Begin Label Label5 
  378.       Caption         =   "picCursorMask"
  379.       Height          =   195
  380.       Left            =   1320
  381.       TabIndex        =   9
  382.       Top             =   4680
  383.       Width           =   1260
  384.    End
  385.    Begin Label Label2 
  386.       AutoSize        =   -1  'True
  387.       Caption         =   "picCursor"
  388.       Height          =   195
  389.       Left            =   1500
  390.       TabIndex        =   8
  391.       Top             =   3120
  392.       Width           =   810
  393.    End
  394.    Begin Line Line1 
  395.       BorderWidth     =   2
  396.       X1              =   660
  397.       X2              =   6600
  398.       Y1              =   660
  399.       Y2              =   660
  400.    End
  401.    Begin Label Label3 
  402.       Caption         =   "Move the mouse pointer over the form and controls to see the cursor changes.  Use the mouse on the controls to test the hot spots."
  403.       ForeColor       =   &H00FF0000&
  404.       Height          =   435
  405.       Left            =   720
  406.       TabIndex        =   1
  407.       Top             =   120
  408.       Width           =   6015
  409.       WordWrap        =   -1  'True
  410.    End
  411. End
  412. Dim ciForm      As CursorInfo
  413. Dim ciVScroll   As CursorInfo
  414. Dim ciText      As CursorInfo
  415. Dim ciOption    As CursorInfo
  416. Dim ciCommand   As CursorInfo
  417. Dim ciLabel     As CursorInfo
  418. Dim ciImage     As CursorInfo
  419.  
  420. Sub CheckFormCursor (hCursor As Integer)
  421. Static hFormCursor As Integer
  422.     If hFormCursor <> hCursor Then
  423.        z% = ChangeCursor(ciForm.hWnd, hCursor)
  424.        hFormCursor = hCursor
  425.     End If
  426. End Sub
  427.  
  428. Sub cmdExit_Click ()
  429.     Unload CursorDemo
  430. End Sub
  431.  
  432. Sub Form_Load ()
  433.     MakeCursor CursorDemo.hWnd, picCursor0, picCursorMask0, ciForm
  434.     MakeCursor Command1.hWnd, picCursor1, picCursorMask1, ciCommand
  435.     MakeCursor Text1.hWnd, picCursor2, picCursorMask2, ciText
  436.     MakeCursor Option1.hWnd, picCursor3, picCursorMask3, ciOption
  437.     MakeCursor VScroll1.hWnd, picCursor4, picCursorMask4, ciVScroll
  438.     MakeCursor CursorDemo.hWnd, picCursor5, picCursorMask5, ciImage
  439.     MakeCursor CursorDemo.hWnd, picCursor6, picCursorMask6, ciLabel
  440.     
  441.     CheckFormCursor ciForm.hNewCursor
  442. End Sub
  443.  
  444. Sub Form_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  445.     CheckFormCursor ciForm.hNewCursor
  446. End Sub
  447.  
  448. Sub Form_Unload (Cancel As Integer)
  449.     RestoreCursor ciVScroll
  450.     RestoreCursor ciText
  451.     RestoreCursor ciOption
  452.     RestoreCursor ciCommand
  453.     RestoreCursor ciLabel
  454.     RestoreCursor ciImage
  455.     RestoreCursor ciForm
  456.     End
  457. End Sub
  458.  
  459. Sub Image1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  460.     CheckFormCursor ciImage.hNewCursor
  461. End Sub
  462.  
  463. Sub Label1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  464.     CheckFormCursor ciLabel.hNewCursor
  465. End Sub
  466.  
  467.