VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ListView + TextBox

0 REPLIES 0
Reply
Message 1 of 1
cubuscoil
340 Views, 0 Replies

ListView + TextBox

I need to edit ListView's ( variable lstView) cells. I tried to place TextBox ( variable edBox) above the ListView for editing. Code is shown bellow:

Private Sub lstView_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As stdole.OLE_XPOS_PIXELS, ByVal y As stdole.OLE_YPOS_PIXELS)

Dim hti As LVHITTESTINFO
Dim lngRet As Long
hti.pt.x = x
hti.pt.y = y
lngRet = SendMessage(lstView.hWnd, LVM_SUBITEMHITTEST, 0&, hti)

oRow = cRow
oCol = cCol

cRow = hti.lngItem
cCol = hti.lngSubItem

If cRow = -1 Or cCol = -1 Then Exit Sub

edBox.Left = lstView.ColumnHeaders(cCol + 1).Left + lstView.Left
edBox.Width = lstView.ColumnHeaders(cCol + 1).Width

Dim item As ListItem

Set item = lstView.ListItems(cRow + 1)
edBox.top = item.top + lstView.top
edBox.Height = item.Height
If cCol = 0 Then
edBox.Text = item.Text
Else
edBox.Text = item.SubItems(cCol)
End If

edBox.ZOrder 0
edBox.SetFocus

End Sub


But TextBox don't appear. Please, help.
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost