home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 25: Programming / pc_actual_25.iso / Basic / GridOne / setup.EXE / SIMPLE.VB < prev    next >
Encoding:
Text File  |  2001-09-09  |  3.1 KB  |  106 lines

  1. '-----------------------------------------------------------------------------
  2. ' This is a part of the BeeGrid ActiveX control.
  3. ' Copyright ⌐ 2000 Stinga
  4. ' All rights reserved.
  5. '
  6. ' You have a right to use and distribute the BeeGrid sample files in original
  7. ' form or modified, provided that you agree that Stinga has no warranty,
  8. ' obligations, or liability for any sample application files.
  9. '-----------------------------------------------------------------------------
  10. Option Strict Off
  11. Imports System
  12. Imports System.ComponentModel
  13. Imports System.Drawing
  14. Imports System.WinForms
  15. Imports Microsoft.VisualBasic
  16.  
  17. Imports System.Data
  18. Imports System.Data.SQL
  19.  
  20. Namespace Win32Form1Namespace 
  21.  
  22.     Public Class BeeGrid
  23.             Inherits System.WinForms.Form
  24.  
  25.             'Required by the Win Forms Designer   
  26.             Private components As System.ComponentModel.Container
  27.             Private mMenu As System.WinForms.MainMenu
  28.          Private WithEvents Button1 As System.WinForms.Button
  29.          Private WithEvents Button2 As System.WinForms.Button
  30.             Private AxSGGrid1 As AxBeeGridOLEDB10.AxSGGrid
  31.     
  32.         Public Sub New()
  33.                 MyBase.New
  34.  
  35.                 'This call is required by the Win Forms Designer.
  36.                 InitializeComponent                        
  37.  
  38.         End Sub
  39.  
  40.         'Clean up any resources being used
  41.         Overrides Public Sub Dispose()
  42.             MyBase.Dispose
  43.             components.Dispose
  44.         End Sub 
  45.  
  46.         'The main entry point for the application
  47.         Shared Sub Main()
  48.             System.WinForms.Application.Run(New BeeGrid())
  49.         End Sub
  50.  
  51.         Private Sub InitializeComponent() 
  52.             Me.components = New System.ComponentModel.Container
  53.             Me.AxSGGrid1 = New AxBeeGridOLEDB10.AxSGGrid
  54.             Me.Button1 = New System.WinForms.Button
  55.  
  56.             AxSGGrid1.BeginInit()
  57.  
  58.             AxSGGrid1.TabIndex = 0
  59.             AxSGGrid1.Size = New System.Drawing.Size(464, 320)            
  60.  
  61.             Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
  62.             Me.Text = "VB.NET BeeGrid Example"
  63.             '@design Me.TrayLargeIcon = True
  64.             '@design Me.TrayHeight = 0
  65.             Me.ClientSize = New System.Drawing.Size(472, 373)
  66.  
  67.             Button1.Location = New System.Drawing.Point(328, 328)
  68.             Button1.Size = New System.Drawing.Size(112, 32)
  69.             Button1.TabIndex = 1
  70.             Button1.Text = "Close"              
  71.  
  72.             Me.Controls.Add(Button1)
  73.             Me.Controls.Add(AxSGGrid1)
  74.  
  75.             AxSGGrid1.EndInit()
  76.             PopulateGrid
  77.         End Sub
  78.  
  79.           Protected Sub PopulateGrid() 
  80.             Dim i as Integer
  81.                 Dim j As Integer
  82.  
  83.                 With Me.AxSGGrid1
  84.                     .DataColCount = 10
  85.                     .DataRowCount = 30
  86.                     .AllowEdit = True
  87.                     .AllowAddNew = True
  88.                     
  89.                     For i = 0 To .DataColCount - 1
  90.                         For j = 0 To .DataRowCount - 1
  91.                             .Array.Value(j, i) = "Col " & i & " row " & j
  92.                         Next
  93.                     Next
  94.                 End With
  95.         End Sub
  96.  
  97.         Protected Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  98.  
  99.                 Me.Close
  100.          
  101.         End Sub
  102.  
  103.     End Class
  104.  
  105. End Namespace
  106.