Torna al Thread

Dim btn1 As New DataGridViewButtonColumn() DataGridView1.Columns.Add(btn1) btn1.HeaderText = "Tesserino" btn1.Text = "Tesserino" btn1.Name = "btn" btn1.UseColumnTextForButtonValue = True Try Connection.Open() Dim cmd As New MySqlCommand("select * from tesserini", Connection) Dim dr As MySqlDataReader = cmd.ExecuteReader If dr.Read() Then For i As Integer = 0 To DataGridView1.RowCount - 1 If Me.DataGridView1.Rows(Me.DataGridView1.CurrentRow.Index).Cells("ID").Value = dr("ID") Then style.BackColor = Color.Green btn1.DefaultCellStyle = style btn1.FlatStyle = FlatStyle.Flat Else style.BackColor = Color.Red btn1.DefaultCellStyle = style btn1.FlatStyle = FlatStyle.Flat End If Next End If Catch ex As Exception End Try Connection.Close()
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5