Seabra Posted April 3, 2012 Report Share Posted April 3, 2012 Olá, Com o código que mostro em baixo pretendo que apareça uma combobox numa Datagridview. A combobox aparece mas corretamente mas quando mudo de célula, a combobox não desaparece da célula anterior. Qual é a forma de apagar a combobox da célula aonterior? Cumprimentos Private Sub DataGridView1_CellClick(sender As Object, e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick Dim comboBoxCell As New DataGridViewComboBoxCell comboBoxCell.Items.Add("1") comboBoxCell.Items.Add("2") comboBoxCell.Items.Add("3") Me.DataGridView1(DataGridView1.CurrentCell.ColumnIndex, DataGridView1.CurrentCell.RowIndex) = comboBoxCell End Sub Link to comment Share on other sites More sharing options...
Andrepereira9 Posted April 3, 2012 Report Share Posted April 3, 2012 Boas No evento .CellLeave mete isto: Dim TextBoxCell As New DataGridViewTextBoxCell Try Me.DataGridView1(DataGridView1.CurrentCell.ColumnIndex, DataGridView1.CurrentCell.RowIndex) = TextBoxCell Catch End Try A informática chegou para resolver problemas que antes não existiam Quem ri por último é porque está conectado a 52 Kbs. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now