Visual Basic Customization

Visual Basic Customization

Reply
Contributor
cubuscoil
Posts: 19
Registered: ‎04-27-2008
Message 1 of 1 (127 Views)

ListView + TextBox

127 Views, 0 Replies
11-30-2009 06:18 AM
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.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!