Visual Basic Customization

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

ListView + TextBox

116 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.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community