■
こうなってくると、エディタでポチポチと入力する意味がまるでないんだけど、とりあえず。
DataGridを使うときのWindowsアプリケーションのスケルトン。
Ole DBを使用してデータを読み込むときに使えるかも。
上部のテキストボックスはSQL文を入力するのに使用するといいか。で、読んできて表示するのはボタンのクリックイベントを使用する。
コンパイルオプションは、
Option Explicit
Option StrictImports System
Imports System.Windows.Forms
Imports System.Drawing
Imports System.Data
'Imports System.Data.SqlClient
'Imports System.XmlPublic Class frmMain
Inherits System.Windows.Forms.FormFriend WithEvents pnlPanel As System.Windows.Forms.Panel
Friend WithEvents cbAccept As System.Windows.Forms.Button
Friend WithEvents txtEnteredText As System.Windows.Forms.TextBox
Friend WithEvents dgdDataGrid As System.Windows.Forms.DataGridShared Sub Main()
System.Windows.Forms.Application.Run( New frmMain() )
End SubPublic Sub New()
MyBase.New()Me.pnlPanel = New System.Windows.Forms.Panel()
Me.cbAccept = New System.Windows.Forms.Button()
Me.txtEnteredText = New System.Windows.Forms.TextBox()
Me.dgdDataGrid = New System.Windows.Forms.DataGrid()
Me.pnlPanel.SuspendLayout()
CType(Me.dgdDataGrid, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
' pnlPanel
'
Me.pnlPanel.Controls.Add(Me.txtEnteredText)
Me.pnlPanel.Controls.Add(Me.cbAccept)
Me.pnlPanel.Dock = System.Windows.Forms.DockStyle.Top
Me.pnlPanel.Location = New System.Drawing.Point(0, 0)
Me.pnlPanel.Name = "panel"
Me.pnlPanel.Size = New System.Drawing.Size(292, 27)
Me.pnlPanel.TabIndex = 0
'
' cbAccept
'
Me.cbAccept.Location = New System.Drawing.Point(0, 0)
Me.cbAccept.Name = "cbAccept"
Me.cbAccept.TabIndex = 0
Me.cbAccept.Text = "Accept"
'
' txtEnteredText
'
Me.txtEnteredText.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.txtEnteredText.Location = New System.Drawing.Point(78, 3)
Me.txtEnteredText.Name = "txtEnteredText"
Me.txtEnteredText.Size = New System.Drawing.Size(210, 19)
Me.txtEnteredText.TabIndex = 1
Me.txtEnteredText.text = "TextBox1"
'
' dgdDataGrid
'
Me.dgdDataGrid.DataMember = ""
Me.dgdDataGrid.Dock = System.Windows.Forms.DockStyle.Fill
Me.dgdDataGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText
Me.dgdDataGrid.Location = New System.Drawing.Point(0, 27)
Me.dgdDataGrid.Name = "dgdDataGrid"
Me.dgdDataGrid.Location = New System.Drawing.Point(292, 246)
Me.dgdDataGrid.TabIndex = 1
'
' frmMain
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 12)
Me.ClientSize = New System.Drawing.Size(292, 273)
Me.MinimumSize = New System.Drawing.Size(292, 273)
Me.Controls.Add(Me.dgdDataGrid)
Me.Controls.Add(Me.pnlPanel)
Me.Name = "frmMain"
Me.Text = "DataGrid Form"
Me.pnlPanel.ResumeLayout(False)
CType(Me.dgdDataGrid, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
End Class
vbc /t:winexe /r:system.dll,system.windows.forms.dll,system.drawing.dll,system.data.dll /debug+ HOGEHOGE.vb