home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / tool / various / dbgrid / demoform.frm < prev    next >
Text File  |  1995-02-27  |  23KB  |  910 lines

  1. VERSION 2.00
  2. Begin Form DemoForm 
  3.    Caption         =   "DBT Grid Demonstration Program"
  4.    ClientHeight    =   4020
  5.    ClientLeft      =   1065
  6.    ClientTop       =   1980
  7.    ClientWidth     =   7365
  8.    FontBold        =   -1  'True
  9.    FontItalic      =   0   'False
  10.    FontName        =   "Wingdings"
  11.    FontSize        =   7.5
  12.    FontStrikethru  =   0   'False
  13.    FontUnderline   =   0   'False
  14.    Height          =   4950
  15.    Left            =   1005
  16.    LinkMode        =   1  'Source
  17.    LinkTopic       =   "Form1"
  18.    ScaleHeight     =   4020
  19.    ScaleWidth      =   7365
  20.    Top             =   1110
  21.    Width           =   7485
  22.    Begin DBTGrid DBTGrid1 
  23.       AbortEditKey    =   27
  24.       About           =   "Copyright (C)-1993, by Douglas A. Bebber"
  25.       BackColor       =   &H00FFFFFF&
  26.       BeginEditKey    =   113
  27.       ColumnHeading   =   ""
  28.       Columns         =   9
  29.       DataModel       =   0  '0-Small
  30.       EndEditKey      =   13
  31.       ForeColor       =   &H00000000&
  32.       Height          =   3075
  33.       Horizontals     =   1  '1-True
  34.       Left            =   120
  35.       RowLabels       =   2  '2-RowNumbers
  36.       Rows            =   30
  37.       SelectBackColor =   &H00000000&
  38.       SelectForeColor =   &H00FFFFFF&
  39.       TabIndex        =   12
  40.       Text            =   ""
  41.       Top             =   660
  42.       Width           =   7155
  43.    End
  44.    Begin TextBox TopVRow 
  45.       BorderStyle     =   0  'None
  46.       Enabled         =   0   'False
  47.       Height          =   255
  48.       Left            =   5940
  49.       TabIndex        =   11
  50.       Top             =   300
  51.       Width           =   675
  52.    End
  53.    Begin TextBox NVisibleRows 
  54.       BorderStyle     =   0  'None
  55.       Enabled         =   0   'False
  56.       Height          =   255
  57.       Left            =   3120
  58.       TabIndex        =   7
  59.       Top             =   300
  60.       Width           =   735
  61.    End
  62.    Begin TextBox RowPosition 
  63.       BorderStyle     =   0  'None
  64.       Enabled         =   0   'False
  65.       Height          =   255
  66.       Left            =   780
  67.       TabIndex        =   2
  68.       Top             =   300
  69.       Width           =   675
  70.    End
  71.    Begin TextBox LeftColumn 
  72.       BorderStyle     =   0  'None
  73.       Enabled         =   0   'False
  74.       Height          =   195
  75.       Left            =   5940
  76.       TabIndex        =   9
  77.       Top             =   0
  78.       Width           =   615
  79.    End
  80.    Begin TextBox NVisibleColumns 
  81.       BorderStyle     =   0  'None
  82.       Enabled         =   0   'False
  83.       Height          =   255
  84.       Left            =   3180
  85.       TabIndex        =   5
  86.       Top             =   0
  87.       Width           =   615
  88.    End
  89.    Begin TextBox ColumnPosition 
  90.       BorderStyle     =   0  'None
  91.       Enabled         =   0   'False
  92.       Height          =   255
  93.       Left            =   780
  94.       TabIndex        =   3
  95.       Top             =   0
  96.       Width           =   615
  97.    End
  98.    Begin Label Label4 
  99.       Caption         =   "Top Visible Row:"
  100.       Height          =   255
  101.       Left            =   4140
  102.       TabIndex        =   10
  103.       Top             =   300
  104.       Width           =   1515
  105.    End
  106.    Begin Label Label2 
  107.       Caption         =   "Visible Rows:"
  108.       Height          =   255
  109.       Left            =   1860
  110.       TabIndex        =   6
  111.       Top             =   300
  112.       Width           =   1215
  113.    End
  114.    Begin Label RowLabel 
  115.       Caption         =   "Row:"
  116.       Height          =   255
  117.       Left            =   0
  118.       TabIndex        =   0
  119.       Top             =   300
  120.       Width           =   495
  121.    End
  122.    Begin Label Label3 
  123.       Caption         =   "Left Visible Column:"
  124.       Height          =   195
  125.       Left            =   4200
  126.       TabIndex        =   8
  127.       Top             =   0
  128.       Width           =   1695
  129.    End
  130.    Begin Label Label1 
  131.       Caption         =   "Visible Columns:"
  132.       Height          =   255
  133.       Left            =   1680
  134.       TabIndex        =   4
  135.       Top             =   0
  136.       Width           =   1455
  137.    End
  138.    Begin Label ColumnLabel 
  139.       Caption         =   "Column:"
  140.       Height          =   255
  141.       Left            =   0
  142.       TabIndex        =   1
  143.       Top             =   0
  144.       Width           =   735
  145.    End
  146.    Begin Menu MNU_GridSettings 
  147.       Caption         =   "&Grid Settings"
  148.       Begin Menu MNU_ColS 
  149.          Caption         =   "&Columns"
  150.          Begin Menu MNU_ColumnLabels 
  151.             Caption         =   "&Column labels"
  152.             Begin Menu MNU_ColLabelsNone 
  153.                Caption         =   "&None"
  154.             End
  155.             Begin Menu MNU_ColLabelLetters 
  156.                Caption         =   "&Letters"
  157.             End
  158.             Begin Menu MNU_ColLabNum 
  159.                Caption         =   "&Numbers"
  160.             End
  161.             Begin Menu MNU_ColLabelUser 
  162.                Caption         =   "&User defined"
  163.                Checked         =   -1  'True
  164.             End
  165.          End
  166.          Begin Menu MNU_ColFix 
  167.             Caption         =   "&Fix"
  168.             Begin Menu MNU_ColFixTrue 
  169.                Caption         =   "&True"
  170.             End
  171.             Begin Menu MNU_ColFixFalse 
  172.                Caption         =   "&False"
  173.                Checked         =   -1  'True
  174.             End
  175.          End
  176.          Begin Menu MNU_ColResize 
  177.             Caption         =   "&Resize"
  178.             Begin Menu MNU_ColResizeTrue 
  179.                Caption         =   "&True"
  180.                Checked         =   -1  'True
  181.             End
  182.             Begin Menu MNU_ColResizeFalse 
  183.                Caption         =   "&False"
  184.             End
  185.          End
  186.          Begin Menu MNU_ColSelect 
  187.             Caption         =   "&Selection"
  188.             Begin Menu MNU_ColSelNone 
  189.                Caption         =   "&None"
  190.                Checked         =   -1  'True
  191.             End
  192.             Begin Menu MNU_ColSelectSingle 
  193.                Caption         =   "&Single Column"
  194.             End
  195.             Begin Menu MNU_ColSelMulti 
  196.                Caption         =   "&Multi Column"
  197.             End
  198.          End
  199.       End
  200.       Begin Menu MNU_EditKeys 
  201.          Caption         =   "Edit &keys"
  202.          Begin Menu MNU_AEK 
  203.             Caption         =   "&AbortEditKey"
  204.          End
  205.          Begin Menu MNU_BEK 
  206.             Caption         =   "&BeginEditKey"
  207.          End
  208.          Begin Menu MNU_EEK 
  209.             Caption         =   "&EndEditKey"
  210.          End
  211.       End
  212.       Begin Menu MNU_Edit 
  213.          Caption         =   "&Edit mode"
  214.          Begin Menu MNU_EditOn 
  215.             Caption         =   "O&n"
  216.             Checked         =   -1  'True
  217.          End
  218.          Begin Menu MNU_EditOff 
  219.             Caption         =   "O&ff"
  220.          End
  221.       End
  222.       Begin Menu MNU_Font 
  223.          Caption         =   "&Fonts"
  224.          Begin Menu MNU_FBold 
  225.             Caption         =   "Bold"
  226.             Begin Menu MNU_FBT 
  227.                Caption         =   "True"
  228.                Checked         =   -1  'True
  229.             End
  230.             Begin Menu MNU_FBF 
  231.                Caption         =   "False"
  232.             End
  233.          End
  234.          Begin Menu MNU_FontName 
  235.             Caption         =   "Name"
  236.             Begin Menu MNU_Arial 
  237.                Caption         =   "Arial"
  238.             End
  239.             Begin Menu MNU_Courier 
  240.                Caption         =   "Courier"
  241.             End
  242.             Begin Menu MNU_Fences 
  243.                Caption         =   "Fences"
  244.             End
  245.             Begin Menu MNU_Fixedsys 
  246.                Caption         =   "Fixedsys"
  247.             End
  248.             Begin Menu MNU_Modern 
  249.                Caption         =   "Modern"
  250.             End
  251.             Begin Menu MNU_MSS 
  252.                Caption         =   "MS Sans Serif"
  253.             End
  254.             Begin Menu MNU_MSSerif 
  255.                Caption         =   "MS Serif"
  256.             End
  257.             Begin Menu MNU_MTExtra 
  258.                Caption         =   "MT Extra"
  259.             End
  260.             Begin Menu MNU_Roman 
  261.                Caption         =   "Roman"
  262.             End
  263.             Begin Menu MNU_Script 
  264.                Caption         =   "Script"
  265.             End
  266.             Begin Menu MNU_SmallFonts 
  267.                Caption         =   "Small Fonts"
  268.             End
  269.             Begin Menu MNU_Symbol 
  270.                Caption         =   "Symbol"
  271.             End
  272.             Begin Menu MNU_System 
  273.                Caption         =   "System"
  274.             End
  275.             Begin Menu MNU_Terminal 
  276.                Caption         =   "Terminal"
  277.             End
  278.             Begin Menu MNU_TNR 
  279.                Caption         =   "Times New Roman"
  280.             End
  281.             Begin Menu MNU_WDG 
  282.                Caption         =   "Wingdings"
  283.             End
  284.          End
  285.       End
  286.       Begin Menu MNU_GridLines 
  287.          Caption         =   "&Grid lines"
  288.          Begin Menu MNU_Horiz 
  289.             Caption         =   "&Horizontals"
  290.             Begin Menu MNU_HorizOn 
  291.                Caption         =   "O&n"
  292.                Checked         =   -1  'True
  293.             End
  294.             Begin Menu MNU_HorizOff 
  295.                Caption         =   "O&ff"
  296.             End
  297.          End
  298.          Begin Menu MNU_Verts 
  299.             Caption         =   "&Verticals"
  300.             Begin Menu MNU_RowVertOn 
  301.                Caption         =   "O&n"
  302.             End
  303.             Begin Menu MNU_VertsOff 
  304.                Caption         =   "O&ff"
  305.             End
  306.          End
  307.       End
  308.       Begin Menu MNU_RowS 
  309.          Caption         =   "&Rows"
  310.          Begin Menu MNU_RowLab 
  311.             Caption         =   "&Labels"
  312.             Begin Menu MNU_RowLabNo 
  313.                Caption         =   "&None"
  314.             End
  315.             Begin Menu MNU_RowLabBut 
  316.                Caption         =   "Row &buttons"
  317.             End
  318.             Begin Menu MNU_RowLabNum 
  319.                Caption         =   "Row &numbers"
  320.                Checked         =   -1  'True
  321.             End
  322.          End
  323.          Begin Menu MNU_RowSel 
  324.             Caption         =   "&Selection"
  325.             Begin Menu MNU_RowSelNone 
  326.                Caption         =   "&None"
  327.                Checked         =   -1  'True
  328.             End
  329.             Begin Menu MNU_RowSelSingle 
  330.                Caption         =   "&Single Row"
  331.             End
  332.             Begin Menu MNU_RowSelMulti 
  333.                Caption         =   "&Multi row"
  334.             End
  335.          End
  336.       End
  337.    End
  338.    Begin Menu MNU_Delete 
  339.       Caption         =   "&Delete"
  340.       Begin Menu MNU_DeleteColumn 
  341.          Caption         =   "&Column"
  342.       End
  343.       Begin Menu MNU_DeleteRow 
  344.          Caption         =   "&Row"
  345.       End
  346.    End
  347.    Begin Menu MNU_Insert 
  348.       Caption         =   "&Insert"
  349.       Begin Menu MNU_InsertColumn 
  350.          Caption         =   "&Column"
  351.       End
  352.       Begin Menu MNU_InsertRow 
  353.          Caption         =   "&Row"
  354.       End
  355.    End
  356.    Begin Menu MNU_MoveIt 
  357.       Caption         =   "&Move"
  358.       Begin Menu MNU_MoveColumn 
  359.          Caption         =   "&Column"
  360.       End
  361.       Begin Menu MNU_MoveRow 
  362.          Caption         =   "&Row"
  363.       End
  364.    End
  365.    Begin Menu MNU_Quit 
  366.       Caption         =   "&Quit"
  367.    End
  368. End
  369. Sub DBTGrid1_CellDoubleClicked (Column As Integer, Row As Long)
  370. MsgBox "Cell Value: " + DBTGrid1.Text
  371. End Sub
  372.  
  373. Sub DBTGrid1_CellValueChanged (Column As Integer, Row As Long)
  374. If (DBTGrid1.Column <> DBTGrid1.Columns - 1) Then
  375.     DBTGrid1.Column = DBTGrid1.Column + 1
  376. Else
  377.     DBTGrid1.Column = 0
  378.     DBTGrid1.Row = DBTGrid1.Row + 1
  379. End If
  380.  
  381. End Sub
  382.  
  383. Sub DBTGrid1_GridHScroll ()
  384.  
  385. 'Update the Left Visible Column display (in user units).
  386. LeftColumn.Text = Str$(DBTGrid1.LeftVisibleColumn + 1)
  387. End Sub
  388.  
  389. Sub DBTGrid1_GridPositionChanged (Column As Integer, Row As Long)
  390.     'Display current row and column (in user units, i.e., + 1)
  391.     ColumnPosition.Text = Str$(Column + 1)
  392.     RowPosition.Text = Str$(Row + 1)
  393. End Sub
  394.  
  395. Sub DBTGrid1_GridVScroll ()
  396. 'Update the Top Visible Row display (in user units).
  397. TopVRow.Text = Str$(DBTGrid1.TopVisibleRow + 1)
  398. End Sub
  399.  
  400. Sub DBTGrid1_Resize ()
  401.  
  402. 'Update the Visible Columns display.
  403. NVisibleColumns.Text = Str$(DBTGrid1.VisibleColumns)
  404.  
  405. 'Update the Visible Rows display.
  406. NVisibleRows.Text = Str$(DBTGrid1.VisibleRows)
  407.  
  408.  
  409. End Sub
  410.  
  411. Sub FillGrid ()
  412. DBTGrid1.Column = 0
  413. DBTGrid1.Row = 0
  414.  
  415. DBTGrid1.Text = "123459"
  416. DBTGrid1.Column = 1
  417. DBTGrid1.Text = "Doe"
  418. DBTGrid1.Column = 2
  419. DBTGrid1.Text = "John"
  420. DBTGrid1.Column = 3
  421. DBTGrid1.Text = "T"
  422. DBTGrid1.Column = 4
  423. DBTGrid1.Text = "1212 Westwood Ave."
  424. DBTGrid1.Column = 5
  425. DBTGrid1.Text = "Moline"
  426. DBTGrid1.Column = 6
  427. DBTGrid1.Text = "IL"
  428. DBTGrid1.Column = 7
  429. DBTGrid1.Text = "61265"
  430. DBTGrid1.Column = 8
  431. DBTGrid1.Text = "(309) 762-4444"
  432.  
  433. DBTGrid1.Row = DBTGrid1.Row + 1 'Move to Next row
  434.  
  435. DBTGrid1.Column = 0
  436. DBTGrid1.Text = "623857"
  437. DBTGrid1.Column = 1
  438. DBTGrid1.Text = "Smith"
  439. DBTGrid1.Column = 2
  440. DBTGrid1.Text = "Mary"
  441. DBTGrid1.Column = 3
  442. DBTGrid1.Text = "J"
  443. DBTGrid1.Column = 4
  444. DBTGrid1.Text = "4733 Carry Street"
  445. DBTGrid1.Column = 5
  446. DBTGrid1.Text = "Davenport"
  447. DBTGrid1.Column = 6
  448. DBTGrid1.Text = "IA"
  449. DBTGrid1.Column = 7
  450. DBTGrid1.Text = "52803"
  451. DBTGrid1.Column = 8
  452. DBTGrid1.Text = "(319) 326-8088"
  453.  
  454. DBTGrid1.Row = DBTGrid1.Row + 1 'Move to Next row
  455.  
  456. DBTGrid1.Column = 0
  457. DBTGrid1.Text = "883853"
  458. DBTGrid1.Column = 1
  459. DBTGrid1.Text = "Hall"
  460. DBTGrid1.Column = 2
  461. DBTGrid1.Text = "Scot"
  462. DBTGrid1.Column = 3
  463. DBTGrid1.Text = "E"
  464. DBTGrid1.Column = 4
  465. DBTGrid1.Text = "1114 Sparrow Road"
  466. DBTGrid1.Column = 5
  467. DBTGrid1.Text = "Rock Island"
  468. DBTGrid1.Column = 6
  469. DBTGrid1.Text = "IL"
  470. DBTGrid1.Column = 7
  471. DBTGrid1.Text = "61201"
  472. DBTGrid1.Column = 8
  473. DBTGrid1.Text = "(309) 788-8086"
  474.  
  475.  
  476. 'Move back to Row 0 Column 0
  477. DBTGrid1.Row = 0
  478. DBTGrid1.Column = 0
  479. End Sub
  480.  
  481.  
  482.  
  483.  
  484. Sub Form_Load ()
  485.  
  486. DBTGrid1.Top = 700
  487.  
  488. 'Define the number of rows and columns in the Grid.
  489. DBTGrid1.Columns = 9
  490. DBTGrid1.Rows = 30
  491. 'Let the user select single rows
  492. DBTGrid1.RowSelection = 0
  493.  
  494. 'Now label the Column Headings (keep the default
  495. 'ColumnHeadingStyle = 0-Centered)
  496.  SetColumnHeadings
  497.  
  498. 'OK the Grid's column format has been set.
  499.  
  500. 'Lets put some data in it!
  501. FillGrid
  502.  
  503. 'Update the Visible Columns display.
  504. NVisibleColumns.Text = Str$(DBTGrid1.VisibleColumns)
  505. 'Update the Visible Rows display.
  506. NVisibleRows.Text = Str$(DBTGrid1.VisibleRows)
  507. 'Update the Left Visible Column display (in user units).
  508. LeftColumn.Text = Str$(DBTGrid1.LeftVisibleColumn + 1)
  509. 'Update the Top Visible Row display (in user units).
  510. TopVRow.Text = Str$(DBTGrid1.TopVisibleRow + 1)
  511.  
  512. End Sub
  513.  
  514. Sub Form_Resize ()
  515. DBTGrid1.Top = 700
  516. If (DemoForm.Height > 800) Then
  517.     DBTGrid1.Height = DemoForm.Height - 1500
  518. End If
  519. If (DemoForm.Width > 400) Then
  520.        DBTGrid1.Width = DemoForm.Width - 400
  521. End If
  522.  
  523. End Sub
  524.  
  525. Sub MNU_AEK_Click ()
  526. EditKey = 1
  527. EditKeyForm.Show 1
  528. End Sub
  529.  
  530. Sub MNU_Arial_Click ()
  531. DBTGrid1.FontName = "Arial"
  532. End Sub
  533.  
  534. Sub MNU_BEK_Click ()
  535. EditKey = 2
  536. EditKeyForm.Show 1
  537. End Sub
  538.  
  539. Sub MNU_ColFix_Click ()
  540. temp% = DBTGrid1.FixedColumn
  541. If temp% = 0 Then
  542.    MNU_ColFixFalse.Checked = -1
  543.    MNU_ColFixTrue.Checked = 0
  544. Else
  545.    MNU_ColFixFalse.Checked = 0
  546.    MNU_ColFixTrue.Checked = -1
  547. End If
  548.     
  549. End Sub
  550.  
  551. Sub MNU_ColFixFalse_Click ()
  552. DBTGrid1.FixedColumn = 0    'Not a fixed column.
  553. MNU_ColFixFalse.Checked = -1
  554. MNU_ColFixTrue.Checked = 0
  555. End Sub
  556.  
  557. Sub MNU_ColFixTrue_Click ()
  558. DBTGrid1.FixedColumn = 1    'A fixed column.
  559. MNU_ColFixFalse.Checked = 0
  560. MNU_ColFixTrue.Checked = -1
  561.  
  562. End Sub
  563.  
  564. Sub MNU_ColLabelLetters_Click ()
  565. DBTGrid1.ColumnLabels = DBT_Letters
  566. MNU_ColLabelUser.Checked = 0
  567. MNU_ColLabelsNone.Checked = 0
  568. MNU_ColLabNum.Checked = 0
  569. MNU_ColLabelLetters.Checked = -1
  570.  
  571. End Sub
  572.  
  573. Sub MNU_ColLabelsNone_Click ()
  574. DBTGrid1.ColumnLabels = DBT_None
  575. MNU_ColLabelUser.Checked = 0
  576. MNU_ColLabelsNone.Checked = -1
  577. MNU_ColLabNum.Checked = 0
  578. MNU_ColLabelLetters.Checked = 0
  579.  
  580. End Sub
  581.  
  582. Sub MNU_ColLabelUser_Click ()
  583. DBTGrid1.ColumnLabels = DBT_UserDefined
  584. MNU_ColLabelUser.Checked = -1
  585. MNU_ColLabelsNone.Checked = 0
  586. MNU_ColLabNum.Checked = 0
  587. MNU_ColLabelLetters.Checked = 0
  588. End Sub
  589.  
  590. Sub MNU_ColLabNum_Click ()
  591. DBTGrid1.ColumnLabels = DBT_Numbers
  592. MNU_ColLabelUser.Checked = 0
  593. MNU_ColLabelsNone.Checked = 0
  594. MNU_ColLabNum.Checked = -1
  595. MNU_ColLabelLetters.Checked = 0
  596.  
  597. End Sub
  598.  
  599. Sub MNU_ColResize_Click ()
  600. temp% = DBTGrid1.ResizeColumn
  601. If temp% = 0 Then
  602.     MNU_ColResizeTrue.Checked = 0
  603.     MNU_ColResizeFalse.Checked = -1
  604. Else
  605.     MNU_ColResizeTrue.Checked = -1
  606.     MNU_ColResizeFalse.Checked = 0
  607. End If
  608. End Sub
  609.  
  610. Sub MNU_ColResizeFalse_Click ()
  611. DBTGrid1.ResizeColumn = 0   'Do not allow resizing of column
  612. MNU_ColResizeTrue.Checked = 0
  613. MNU_ColResizeFalse.Checked = -1
  614.  
  615. End Sub
  616.  
  617. Sub MNU_ColResizeTrue_Click ()
  618. DBTGrid1.ResizeColumn = 1   'Allow resizing of column
  619. MNU_ColResizeTrue.Checked = -1
  620. MNU_ColResizeFalse.Checked = 0
  621. End Sub
  622.  
  623. Sub MNU_ColSelectSingle_Click ()
  624. DBTGrid1.ColumnSelection = DBT_SingleColumn    'Single column selection allowed.
  625. MNU_ColSelNone.Checked = 0
  626. MNU_ColSelMulti.Checked = 0
  627. MNU_ColSelectSingle.Checked = -1
  628.  
  629. End Sub
  630.  
  631. Sub MNU_ColSelMulti_Click ()
  632. DBTGrid1.ColumnSelection = DBT_MultiColumn    'Multi column selection allowed.
  633. MNU_ColSelNone.Checked = 0
  634. MNU_ColSelMulti.Checked = -1
  635. MNU_ColSelectSingle.Checked = 0
  636.  
  637. End Sub
  638.  
  639. Sub MNU_ColSelNone_Click ()
  640. DBTGrid1.ColumnSelection = DBT_None    'No column selection allowed.
  641. MNU_ColSelNone.Checked = -1
  642. MNU_ColSelMulti.Checked = 0
  643. MNU_ColSelectSingle.Checked = 0
  644. End Sub
  645.  
  646. Sub MNU_Courier_Click ()
  647. DBTGrid1.FontName = "Courier"
  648. End Sub
  649.  
  650. Sub MNU_DeleteColumn_Click ()
  651.  
  652. 'Delete the current grid column.
  653.  
  654. DBTGrid1.Action = DBT_DeleteColumn
  655.  
  656. End Sub
  657.  
  658. Sub MNU_DeleteRow_Click ()
  659.  
  660. 'Delete the current grid row.
  661.  
  662. DBTGrid1.Action = DBT_DeleteRow
  663.  
  664. End Sub
  665.  
  666. Sub MNU_EditOff_Click ()
  667. DBTGrid1.EditMode = 0
  668. MNU_EditOn.Checked = 0
  669. MNU_EditOff.Checked = -1
  670.  
  671. End Sub
  672.  
  673. Sub MNU_EditOn_Click ()
  674. DBTGrid1.EditMode = 1
  675. MNU_EditOn.Checked = -1
  676. MNU_EditOff.Checked = 0
  677. End Sub
  678.  
  679. Sub MNU_EEK_Click ()
  680. EditKey = 3
  681. EditKeyForm.Show 1
  682. End Sub
  683.  
  684. Sub MNU_FBF_Click ()
  685. DBTGrid1.FontBold = 0
  686. MNU_FBF.Checked = -1
  687. MNU_FBT.Checked = 0
  688. End Sub
  689.  
  690. Sub MNU_FBT_Click ()
  691. DBTGrid1.FontBold = -1
  692. MNU_FBT.Checked = -1
  693. MNU_FBF.Checked = 0
  694. End Sub
  695.  
  696. Sub MNU_Fences_Click ()
  697. DBTGrid1.FontName = "Fences"
  698. End Sub
  699.  
  700. Sub MNU_Fixedsys_Click ()
  701. DBTGrid1.FontName = "Fixedsys"
  702. End Sub
  703.  
  704. Sub MNU_HorizOff_Click ()
  705. DBTGrid1.Horizontals = 0
  706. MNU_HorizOn.Checked = 0
  707. MNU_HorizOff.Checked = -1
  708. End Sub
  709.  
  710. Sub MNU_HorizOn_Click ()
  711. DBTGrid1.Horizontals = 1
  712. MNU_HorizOn.Checked = -1
  713. MNU_HorizOff.Checked = 0
  714. End Sub
  715.  
  716. Sub MNU_InsertColumn_Click ()
  717.  
  718. 'Insert a column before the current grid column.
  719.  
  720. DBTGrid1.Action = DBT_InsertColumn
  721.  
  722. End Sub
  723.  
  724. Sub MNU_InsertRow_Click ()
  725.  
  726. 'Insert a row before the current grid row.
  727.  
  728. DBTGrid1.Action = DBT_InsertRow
  729.  
  730. End Sub
  731.  
  732. Sub MNU_Modern_Click ()
  733. DBTGrid1.FontName = "Modern"
  734. End Sub
  735.  
  736. Sub MNU_MoveColumn_Click ()
  737. NewColumnPosition$ = InputBox$("What column do you wish to move the current column to?", "Move Grid Column", "0")
  738.  
  739. If NewColumnPosition$ = "" Then
  740.     Exit Sub
  741. Else
  742.     DBTGrid1.ColumnNumber = Val(NewColumnPosition$)
  743.     DBTGrid1.Action = DBT_MoveColumn
  744. End If
  745.  
  746.  
  747.  
  748.  
  749. End Sub
  750.  
  751. Sub MNU_MoveRow_Click ()
  752. NewRowPosition$ = InputBox$("What row do you wish to move the current row to?", "Move Grid Row", "0")
  753.  
  754. If NewRowPosition$ = "" Then
  755.     Exit Sub
  756. Else
  757.     DBTGrid1.RowNumber = Val(NewRowPosition$)
  758.     DBTGrid1.Action = DBT_MoveRow
  759. End If
  760.  
  761. End Sub
  762.  
  763. Sub MNU_MSS_Click ()
  764. DBTGrid1.FontName = "MS Sans Serif"
  765. End Sub
  766.  
  767. Sub MNU_MSSerif_Click ()
  768. DBTGrid1.FontName = "MS Serif"
  769. End Sub
  770.  
  771. Sub MNU_MTExtra_Click ()
  772. DBTGrid1.FontName = "MT Extra"
  773. End Sub
  774.  
  775. Sub MNU_Quit_Click ()
  776. End
  777. End Sub
  778.  
  779. Sub MNU_Roman_Click ()
  780. DBTGrid1.FontName = "Roman"
  781. End Sub
  782.  
  783. Sub MNU_RowLabBut_Click ()
  784. DBTGrid1.RowLabels = DBT_RowButtons
  785. MNU_RowLabNum.Checked = 0
  786. MNU_RowLabNo.Checked = 0
  787. MNU_RowLabBut.Checked = -1
  788. End Sub
  789.  
  790. Sub MNU_RowLabNo_Click ()
  791. DBTGrid1.RowLabels = DBT_None
  792. MNU_RowLabNum.Checked = 0
  793. MNU_RowLabNo.Checked = -1
  794. MNU_RowLabBut.Checked = 0
  795. End Sub
  796.  
  797. Sub MNU_RowLabNum_Click ()
  798. DBTGrid1.RowLabels = DBT_Numbers
  799. MNU_RowLabNum.Checked = -1
  800. MNU_RowLabNo.Checked = 0
  801. MNU_RowLabBut.Checked = 0
  802. End Sub
  803.  
  804. Sub MNU_RowSelMulti_Click ()
  805. DBTGrid1.RowSelection = DBT_MultiRow      'Multi row selection allowed.
  806. MNU_RowSelNone.Checked = 0
  807. MNU_RowSelSingle.Checked = 0
  808. MNU_RowSelMulti.Checked = -1
  809.  
  810. End Sub
  811.  
  812. Sub MNU_RowSelNone_Click ()
  813. DBTGrid1.RowSelection = DBT_None      'No row selection allowed.
  814. MNU_RowSelNone.Checked = -1
  815. MNU_RowSelSingle.Checked = 0
  816. MNU_RowSelMulti.Checked = 0
  817. End Sub
  818.  
  819. Sub MNU_RowSelSingle_Click ()
  820. DBTGrid1.RowSelection = DBT_SingleRow      'Single row selection allowed.
  821. MNU_RowSelNone.Checked = 0
  822. MNU_RowSelSingle.Checked = -1
  823. MNU_RowSelMulti.Checked = 0
  824.  
  825. End Sub
  826.  
  827. Sub MNU_RowVertOn_Click ()
  828. DBTGrid1.Verticals = 1
  829. MNU_RowVertOn.Checked = -1
  830. MNU_VertsOff.Checked = 0
  831. End Sub
  832.  
  833. Sub MNU_Script_Click ()
  834. DBTGrid1.FontName = "Script"
  835. End Sub
  836.  
  837. Sub MNU_SmallFonts_Click ()
  838. DBTGrid1.FontName = "Small Fonts"
  839. End Sub
  840.  
  841. Sub MNU_Symbol_Click ()
  842. DBTGrid1.FontName = "Symbol"
  843. End Sub
  844.  
  845. Sub MNU_System_Click ()
  846. DBTGrid1.FontName = "System"
  847. End Sub
  848.  
  849. Sub MNU_Terminal_Click ()
  850. DBTGrid1.FontName = "Terminal"
  851. End Sub
  852.  
  853. Sub MNU_TNR_Click ()
  854. DBTGrid1.FontName = "Times New Roman"
  855. End Sub
  856.  
  857. Sub MNU_VertsOff_Click ()
  858. DBTGrid1.Verticals = 0
  859. MNU_RowVertOn.Checked = 0
  860. MNU_VertsOff.Checked = -1
  861. End Sub
  862.  
  863. Sub MNU_WDG_Click ()
  864. DBTGrid1.FontName = "Wingdings"
  865. End Sub
  866.  
  867. Sub SetColumnHeadings ()
  868.  
  869. DBTGrid1.Column = 0     'Start with Column #1
  870. DBTGrid1.ColumnHeading = "Customer No."
  871. DBTGrid1.CellStyle = 0  'Center text in the Cell
  872.  
  873. DBTGrid1.Column = 1     'Move to Column #2
  874. DBTGrid1.ColumnHeading = "Last Name"
  875. DBTGrid1.CellStyle = 1  'Left justify text in the Cell
  876.  
  877. DBTGrid1.Column = 2     'Move to Column #3
  878. DBTGrid1.ColumnHeading = "First Name"
  879. DBTGrid1.CellStyle = 1  'Left justify text in the Cell
  880.  
  881. DBTGrid1.Column = 3     'Move to Column #4
  882. DBTGrid1.ColumnHeading = "MI"
  883. DBTGrid1.ColumnStringLength = 2
  884. DBTGrid1.CellStyle = 0  'Center text in the Cell
  885.  
  886. DBTGrid1.Column = 4     'Move to Column #5
  887. DBTGrid1.ColumnHeading = "Address"
  888. DBTGrid1.CellStyle = 1  'Left justify text in the Cell
  889.  
  890. DBTGrid1.Column = 5     'Move to Column #6
  891. DBTGrid1.ColumnHeading = "City"
  892. DBTGrid1.CellStyle = 1  'Left justify text in the Cell
  893.  
  894. DBTGrid1.Column = 6     'Move to Column #7
  895. DBTGrid1.ColumnHeading = "State"
  896. DBTGrid1.ColumnStringLength = 3
  897. DBTGrid1.CellStyle = 0  'Center text in the Cell
  898.  
  899. DBTGrid1.Column = 7     'Move to Column #8
  900. DBTGrid1.ColumnHeading = "Zip"
  901. DBTGrid1.CellStyle = 0  'Center text in the Cell
  902.  
  903. DBTGrid1.Column = 8     'Move to Column #9
  904. DBTGrid1.ColumnHeading = "Phone"
  905. DBTGrid1.CellStyle = 0  'Center text in the Cell
  906.  
  907. End Sub
  908.  
  909.  
  910.