Does any one know how to create a editable text field like one that appears in a treeview or a listview control? It can also be seen in the windows explorer or desktop under a file icon. Is there an API function?
Printable View
Does any one know how to create a editable text field like one that appears in a treeview or a listview control? It can also be seen in the windows explorer or desktop under a file icon. Is there an API function?
Here's kind of a silly way to replicate the feature, but I'm sure there is a much better way... :)
Create a form with a single textbox (Text1) and some other control to switch the focus to. Then add the following to the form's code module:
Hope that helps a little!Code:Option Explicit
Private Sub Form_Load()
With Text1
.BackColor = Me.BackColor
.BorderStyle = 0
.Appearance = 0
.TabStop = False
End With
'SomeOtherControl.SetFocus
End Sub
Private Sub Text1_Click()
With Text1
.BackColor = vbWindowBackground
.BorderStyle = vbFixedSingle
.SelStart = 0
.SelLength = Len(.Text)
End With
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
'SomeOtherControl.SetFocus
End If
End Sub
Private Sub Text1_LostFocus()
With Text1
.BackColor = Me.BackColor
.BorderStyle = 0
End With
End Sub
~seaweed
[This message has been edited by seaweed (edited 02-03-2000).]