
List Property in Property Pane (PLEASE HELP!)
I'm going to disagree, but before I do, let me say
that I am working from the premise that I -think-
I know what he is asking for..
Below is a snip of code I'd like you to place into
a new userControl, call it whatever you wish.
Drop a listbox on the control and then Build the OCX
or add another Standard EXE project and make it
the Startup project. Place one of the new controls
on the form and look for the new property in the
development window...
"AddItemsHere"
Type into the property anything you wish and hit enter.
It will show up in the listbox.
hth,
D.
'-- Begin Code Snip --
Private mCol As Collection
Public Property Get AddItemsHere() As String
AddItemsHere = "Add Items Here..."
End Property
Public Property Let AddItemsHere(sItem As String)
If mCol Is Nothing Then
Set mCol = New Collection
End If
mCol.Add sItem
Call RefreshListBox
End Property
Private Sub RefreshListBox()
List1.Clear
For Each xItm In mCol
List1.AddItem xItm
Next
End Sub
Private Sub UserControl_Initialize()
End Sub
'-- End Code Snip --
Quote:
> Bad news... You can't. Some have tried and given up. About the best people
> can come up with is a property page that contains a textbox. You enter the
> List values in that box and parse them into seperate list entries.
> --
> Ken Halter
> MS-MVP-VB
> Please keep it in the groups..
> > I have a Listbox-like custom control I have just created, and this
control
> > has a property called 'List' which will hold the values to be displayed
on
> > my control (just like it happens with a Listbox)
> > The problem is: I just can't "publish" (expose) the List property on the
> > Property Pane in order to let people assign values during design-time
> > through it (not via code).
> > Does anybody knows how to implement this? Or any idea on how this would
> > work?
> > PLEASE HELP, I am desperate!
> > Thank You!