List Property in Property Pane (PLEASE HELP!) 
Author Message
 List Property in Property Pane (PLEASE HELP!)

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!



Wed, 14 Jul 2004 04:33:12 GMT  
 List Property in Property Pane (PLEASE HELP!)
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..


Quote:

> 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!



Wed, 14 Jul 2004 04:53:04 GMT  
 List Property in Property Pane (PLEASE HELP!)
Thanks, Ken.  :-)   I understand.  But then, how come the original Listbox
has a "List" property displayed in the Property Pane with a drop-down
listbox to assign values to it?  I mean, this gotta be something anybody can
implement too, don't you think?  That's what I would like to know or to find
out.

By the way, you say "You can't."  Do you mean, it is proven impossible?  Has
this been stated somewhere?  Or just like you are saying too: "some have
tried and given up", which I interpret that people have tried but they don't
know how to do it *yet*.  If it is just impossible, then, ok, I may give it
up.  But if it may be possible, just like the original Listbox does, then
let's find the way to do it.  Would you help me? :-)

We can then post it here for the benefit of everybody.  In the meanwhile,
I'll use the textbox and parse the values.

Anyone's comments and suggestions are welcomed.

Thanks, Ken, very kind of yours.


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!



Wed, 14 Jul 2004 05:42:25 GMT  
 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!



Wed, 14 Jul 2004 05:50:48 GMT  
 List Property in Property Pane (PLEASE HELP!)
well, I didn't provide a complete solution.

I notice that when run, the dataset is wiped out...

You're going to have to come up with some
way to persist you data between runtime and
design time using either the registry or a file.

D.


Quote:
> 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 --



> > 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!



Wed, 14 Jul 2004 06:09:07 GMT  
 List Property in Property Pane (PLEASE HELP!)
If you click on the List property of the ListBox, there's a combobox
(looking dialog) that opens an lets you enter as many items as you want.
This is the part that you can't duplicate.

--
Ken Halter
MS-MVP-VB
Please keep it in the groups..


Quote:
> 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 --



> > 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!



Wed, 14 Jul 2004 06:11:11 GMT  
 List Property in Property Pane (PLEASE HELP!)
The built in ListBox has access to things that usercontrols don't.. most
likely direct access to the VB runtime.

Quote:
> By the way, you say "You can't."  Do you mean, it is proven impossible?

Has
Nothing's impossible but even the authors of these workarounds called them a
"Hack" and the sample code was removed from... everywhere. I used to know
where to get a sample but it has since vanished.

Of course, (thinking out loud and never tried) you might possibly run an
EnumWindows API to get a hold of the property window and peek inside that
for a property called "List" then show a combo (like) box directly over that
spot. If you check out the multi column combo on my site, you'll see that
both List and ItemData are supported.. but not shown in the property window.

Hopefully Matt C will pop in here and give us the "low down" on this. It's
asked at least once a month or so..

--
Ken Halter
MS-MVP-VB
Please keep it in the groups..


Quote:
> Thanks, Ken.  :-)   I understand.  But then, how come the original Listbox
> has a "List" property displayed in the Property Pane with a drop-down
> listbox to assign values to it?  I mean, this gotta be something anybody
can
> implement too, don't you think?  That's what I would like to know or to
find
> out.

> By the way, you say "You can't."  Do you mean, it is proven impossible?
Has
> this been stated somewhere?  Or just like you are saying too: "some have
> tried and given up", which I interpret that people have tried but they
don't
> know how to do it *yet*.  If it is just impossible, then, ok, I may give
it
> up.  But if it may be possible, just like the original Listbox does, then
> let's find the way to do it.  Would you help me? :-)

> We can then post it here for the benefit of everybody.  In the meanwhile,
> I'll use the textbox and parse the values.

> Anyone's comments and suggestions are welcomed.

> Thanks, Ken, very kind of yours.



Wed, 14 Jul 2004 06:17:48 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. USE PROPERTY PAGE INSTEAD OF PROPERTY PANE!!!

2. Change of focus from the item list pane to the folder list pane in an explorer

3. Help Please Usercontrol List Property

4. Invalid use of property please, please, please help!!!

5. Creating properties pane like control

6. Open Dialog box from the Properties pane.

7. Property Attributes - Help String displayed in property window.

8. PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP,

9. Need help Listing Object Description Properties

10. fixed list of a custom property limits.(help!)

11. Problems with VB and list.selected property HELP!!!

12. Help listing Properties from an object

 

 
Powered by phpBB® Forum Software