📄 sa_club.vb
字号:
Imports System.Data
Imports System.Data.SqlClient
Imports System.IO
Public Class sa_club
Inherits System.Windows.Forms.Form
Dim myconnection As SqlConnection = New _
SqlConnection("server=(local);database=footballplayer_change;" & _
"uid=sa;pwd=sa;")
Dim myadapter As SqlDataAdapter = New SqlDataAdapter("select * from club", myconnection)
Dim myds As DataSet
Dim mydv As DataView
Dim mycurrencymanager As CurrencyManager
Dim selected As Integer
#Region " Windows 窗体设计器生成的代码 "
Public Sub New()
MyBase.New()
'该调用是 Windows 窗体设计器所必需的。
InitializeComponent()
'在 InitializeComponent() 调用之后添加任何初始化
End Sub
'窗体重写处置以清理组件列表。
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer
'注意:以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器修改此过程。
'不要使用代码编辑器修改它。
Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
Friend WithEvents applylist As System.Windows.Forms.DataGrid
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
Friend WithEvents Button2 As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.GroupBox1 = New System.Windows.Forms.GroupBox()
Me.applylist = New System.Windows.Forms.DataGrid()
Me.Button1 = New System.Windows.Forms.Button()
Me.GroupBox2 = New System.Windows.Forms.GroupBox()
Me.Button2 = New System.Windows.Forms.Button()
Me.GroupBox1.SuspendLayout()
CType(Me.applylist, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'GroupBox1
'
Me.GroupBox1.Controls.AddRange(New System.Windows.Forms.Control() {Me.applylist})
Me.GroupBox1.Location = New System.Drawing.Point(24, 24)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(432, 168)
Me.GroupBox1.TabIndex = 0
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "GroupBox1"
'
'applylist
'
Me.applylist.Anchor = (((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right)
Me.applylist.DataMember = ""
Me.applylist.HeaderForeColor = System.Drawing.SystemColors.ControlText
Me.applylist.Location = New System.Drawing.Point(16, 24)
Me.applylist.Name = "applylist"
Me.applylist.Size = New System.Drawing.Size(408, 136)
Me.applylist.TabIndex = 0
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(360, 224)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(80, 24)
Me.Button1.TabIndex = 1
Me.Button1.Text = "修改"
'
'GroupBox2
'
Me.GroupBox2.Location = New System.Drawing.Point(24, 208)
Me.GroupBox2.Name = "GroupBox2"
Me.GroupBox2.Size = New System.Drawing.Size(296, 120)
Me.GroupBox2.TabIndex = 2
Me.GroupBox2.TabStop = False
Me.GroupBox2.Text = "GroupBox2"
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(360, 272)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(80, 24)
Me.Button2.TabIndex = 3
Me.Button2.Text = "删除"
'
'sa_club
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(544, 350)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Button2, Me.GroupBox2, Me.Button1, Me.GroupBox1})
Me.Name = "sa_club"
Me.Text = "apply_manage"
Me.GroupBox1.ResumeLayout(False)
CType(Me.applylist, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub filldatasetandview()
myds = New DataSet()
Try
myadapter.Fill(myds, "club")
Catch ex As Exception
MsgBox(ex.ToString)
End Try
mydv = New DataView(myds.Tables("club"))
mycurrencymanager = CType(Me.BindingContext(mydv), CurrencyManager)
End Sub
Private Sub bindfields()
applylist.DataSource = myds
applylist.DataMember = "club"
End Sub
Private Sub info_bind()
End Sub
Private Sub sa_club_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
filldatasetandview()
bindfields()
' info_bind()
End Sub
Private Sub applylist_Navigate(ByVal sender As System.Object, ByVal ne As System.Windows.Forms.NavigateEventArgs) Handles applylist.Navigate
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'selected = applylist.CurrentRowIndex()
'mycurrencymanager.Position = selected
End Sub
Private Sub applylist_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles applylist.Click
selected = applylist.CurrentRowIndex()
mycurrencymanager.Position = selected
End Sub
Private Sub GroupBox2_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox2.Enter
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -