home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 25: Programming / pc_actual_25.iso / Basic / GridOne / setup.EXE / IMPORTDATA.VB < prev    next >
Encoding:
Text File  |  2001-09-09  |  2.9 KB  |  95 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 AxSGGrid1 As AxBeeGridOLEDB10.AxSGGrid
  30.     
  31.         Public Sub New()
  32.                 MyBase.New
  33.  
  34.                 'This call is required by the Win Forms Designer.
  35.                 InitializeComponent                            
  36.  
  37.         End Sub
  38.  
  39.         'Clean up any resources being used
  40.         Overrides Public Sub Dispose()
  41.             MyBase.Dispose
  42.             components.Dispose
  43.         End Sub 
  44.  
  45.         'The main entry point for the application
  46.         Shared Sub Main()
  47.             System.WinForms.Application.Run(New BeeGrid())
  48.         End Sub
  49.  
  50.         Private Sub InitializeComponent() 
  51.             Me.components = New System.ComponentModel.Container
  52.             Me.AxSGGrid1 = New AxBeeGridOLEDB10.AxSGGrid
  53.             Me.Button1 = New System.WinForms.Button
  54.  
  55.             AxSGGrid1.BeginInit()
  56.  
  57.             AxSGGrid1.TabIndex = 0
  58.             AxSGGrid1.Size = New System.Drawing.Size(464, 320)
  59.                 'AxSGGrid1.AddOnClick(New System.EventHandler(AddressOf Me.AxSGGrid1_Click))                
  60.             Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
  61.             Me.Text = "VB.NET BeeGrid Example"
  62.             Me.ClientSize = New System.Drawing.Size(472, 373)
  63.  
  64.             Button1.Location = New System.Drawing.Point(328, 328)
  65.             Button1.Size = New System.Drawing.Size(112, 32)
  66.             Button1.TabIndex = 1
  67.             Button1.Text = "Close"              
  68.  
  69.             Me.Controls.Add(Button1)
  70.             Me.Controls.Add(AxSGGrid1)
  71.  
  72.             AxSGGrid1.EndInit()
  73.             PopulateGrid
  74.         End Sub
  75.  
  76.          Protected Sub PopulateGrid()
  77.                 Const sgLayoutXML = 1
  78.                 Const sgFormatXML = 1
  79.  
  80.                 With Me.AxSGGrid1
  81.                     .LoadLayoutFromFile("TennisLayout.xml", sgLayoutXML)
  82.                    .ImportData("Tennis.xml", sgFormatXML,"","")
  83.                     .RefreshGroups(1)
  84.                End With
  85.         End Sub
  86.  
  87.             Protected Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  88.                 Me.Close
  89.          
  90.         End Sub
  91.  
  92.     End Class
  93.  
  94. End Namespace
  95.