Ola a todos, este é o meu primeiro tópico, e tenho um grande problema, queria inserir uma DataCombo em uma Data Gride, usei este codigo: Private Sub datagrid1_MouseUp(Button As Integer, _
Shift As Integer, x As Single, y As Single)
Static CurrentWidth As Single
' Check to see if the columns(1).'s width has changed.
If DataGrid1.Columns(1).Width <> CurrentWidth Then
Combo1.Width = DataGrid1.Columns(1).Width
CurrentWidth = DataGrid1.Columns(1).Width
End If
End Sub
Private Sub Form_Load()
Combo1.Visible = False
Combo1.ZOrder (0)
Combo1.Width = DataGrid1.Columns(2).Width
' Load the ComboBox's list.
Combo1.AddItem "Some text"
Combo1.AddItem "Some more text"
Combo1.AddItem "Still more text"
Combo1.AddItem "Yet even more text"
Combo1.AddItem "Way more text than that"
End Sub
Private Sub datagrid1_Click()
' Position and size the ComboBox, then show it.
Combo1.Top = DataGrid1.Columns(2).Top
Combo1.Width = DataGrid1.Columns(2).Width
Combo1.Left = DataGrid1.Columns(2).Left + DataGrid1.Left
Combo1.Top = DataGrid1.Columns(2).Top + DataGrid1.Top
Combo1.Text = DataGrid1.Columns(2).Text
Combo1.Visible = True
End Sub
Private Sub Combo1_Click()
' Place the selected item into the columns(1). and hide the
ComboBox.
DataGrid1.Columns(2).Text = Combo1.Text
Combo1.Visible = False
End Sub
mas ano deu, a combo fica sempre no topo, eu quero que ela aparece no campo Mas eu queria que ele repetice em todos os registos como no access...eu então ao clicar num registo ele ia para esse registo...