In VB6, if we want to put a control on another one, we can set the zorder to be 0. but in VB.net i can't find this property. but i find one method(updateZorder), so there must be a method to set the zorder. anyone knows? thank you!
Private Sub Grid1_KeyPressEvent(ByVal sender As Object, ByVal e As AxMSFlexGridLib.DMSFlexGridEvents_KeyPressEvent) Handles Grid1.KeyPressEvent
'Move the text box to the current grid cell :
Text1.Top = Grid1.CellTop + Grid1.Top
Text1.Left = Grid1.CellLeft + Grid1.Left
'Save the position of the grids Row and Col for later"
gRow = Grid1.Row
gCol = Grid1.Col
'Make text box same size as current grid cell:
Text1.Width = Grid1.CellWidth
Text1.Height = Grid1.CellHeight
'Transfer the grid cell text:
'Text1.Text = Grid1.Text
'Show the text box:
Text1.Visible = True
Text1.BringToFront()
'Text1.SendToBack()
Text1.Focus()
'Redirect this KeyPress event to the text box:
'If e.keyAscii <> ASC_ENTER Then
' SendKeys.Send(Str(e.keyAscii))
'End If
End Sub
'Private Sub Text1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Text1.KeyPress
' If e.KeyChar = Chr(ASC_ENTER) Then
' Grid1.Parent = Grid1
' Grid1.Focus() 'Set focus back to grid, see Text_LostFocus
' End If
'End Sub
Private Sub Text1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles Text1.LostFocus
Dim tmpRow As Integer
Dim tmpCol As Integer
'Save current setting of Grid Row and col, This is needed only if
'the focus is set somewhere else in the Grid
tmpRow = Grid1.Row
tmpCol = Grid1.Col
'Set Row and Col back to what they were before Text1_LostFocus
Grid1.Row = gRow
Grid1.Col = gCol
Grid1.Text = Text1.Text 'Transfer text back to grid
'Text1.SelStart = 0
Text1.Visible = False 'Disable text box
'Return row and Col contents:
Grid1.Row = tmpRow
Grid1.Col = tmpCol
End Sub
Private Sub Grid1_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles Grid1.GotFocus
'Label1.BringToFront()
End Sub