Custom Properties  
Author Message
screenorientation





PostPosted: Wed Jun 30 07:59:46 CDT 2004 Top

Excel Programming >> Custom Properties

I have added an ImageList and Treeview to a userform. I would normally right click on the ImageList to access the custom properties page and add the required icons. However, when I right click on the control the Custom Properties menu is not displayed. Does anyone know why this is occurring?

Excel400  
 
 
keepITcool





PostPosted: Wed Jun 30 07:59:46 CDT 2004 Top

Excel Programming >> Custom Properties David,

did you check there's a valid reference to the control's library..?
.. depending on version the ref s/b like
Microsoft Windows Common Controls 6.0 (SP6)



keepITcool


< homepage: http://members.chello.nl/keepitcool >




> I have added an ImageList and Treeview to a userform. I would normally
> right click on the ImageList to access the custom properties page and
> add the required icons. However, when I right click on the control the
> Custom Properties menu is not displayed. Does anyone know why this is
> occurring?
>

 
 
keepITcool





PostPosted: Wed Jun 30 09:04:12 CDT 2004 Top

Excel Programming >> Custom Properties hmm...

you're not confusing VB6 with VBA?

in VB6 you go straight to the properties bag.
in VBA you need to click (Custom) in the Properties pane.


keepITcool




> Hi,
>
> Yes, the library Microsoft Windows Common Controls 6.0 is referenced.
> To make sure, I've also re-registered the library in \\System32.
>
 
 
keepITcool





PostPosted: Wed Jun 30 11:05:03 CDT 2004 Top

Excel Programming >> Custom Properties as i said..

in VBA you should get the Properties option in the context popup.

if you click that if sets the focus to the properties window and selects
the control. (and opens the prop window it necessary)

then in the properties window ..
select the line with (custom)
double click THAT.

FAIK that's how it's always worked in VBA...
(still think your confused with VB6)

keepITcool


< homepage: http://members.chello.nl/keepitcool >




> No that's just the problem, when I right click I should have the
> 'Custom' option but I only have the generic 'Properties' option. All
> very odd!
>

>
>> hmm...
>>
>> you're not confusing VB6 with VBA?
>>
>> in VB6 you go straight to the properties bag.
>> in VBA you need to click (Custom) in the Properties pane.
>>
>>
>> keepITcool
>>
>>

>>
>> > Hi,
>> >
>> > Yes, the library Microsoft Windows Common Controls 6.0 is
>> > referenced. To make sure, I've also re-registered the library in
>> > \\System32.
>> >
>>
>

 
 
DavidW





PostPosted: Thu Jul 01 01:23:01 CDT 2004 Top

Excel Programming >> Custom Properties How embarrasing! You're right, got it now! Thank you very much for your help!!!



> as i said..
>
> in VBA you should get the Properties option in the context popup.
>
> if you click that if sets the focus to the properties window and selects
> the control. (and opens the prop window it necessary)
>
> then in the properties window ..
> select the line with (custom)
> double click THAT.
>
> FAIK that's how it's always worked in VBA...
> (still think your confused with VB6)
>
> keepITcool
>

> < homepage: http://members.chello.nl/keepitcool >
>
>

>
> > No that's just the problem, when I right click I should have the
> > 'Custom' option but I only have the generic 'Properties' option. All
> > very odd!
> >

> >
> >> hmm...
> >>
> >> you're not confusing VB6 with VBA?
> >>
> >> in VB6 you go straight to the properties bag.
> >> in VBA you need to click (Custom) in the Properties pane.
> >>
> >>
> >> keepITcool
> >>
> >>

> >>
> >> > Hi,
> >> >
> >> > Yes, the library Microsoft Windows Common Controls 6.0 is
> >> > referenced. To make sure, I've also re-registered the library in
> >> > \\System32.
> >> >
> >>
> >
>
>
 
 
DavidW





PostPosted: Thu Jul 01 05:08:01 CDT 2004 Top

Excel Programming >> Custom Properties Just one other question...........! Now that I've populated my ImageList I want to bind it to my TreeView control, however, when I access the ImageList combo on the Property page for the TreeView my ImageList is not listed, it has only one entry in the combo, the default <None>?!




> How embarrasing! You're right, got it now! Thank you very much for your help!!!
>

>
> > as i said..
> >
> > in VBA you should get the Properties option in the context popup.
> >
> > if you click that if sets the focus to the properties window and selects
> > the control. (and opens the prop window it necessary)
> >
> > then in the properties window ..
> > select the line with (custom)
> > double click THAT.
> >
> > FAIK that's how it's always worked in VBA...
> > (still think your confused with VB6)
> >
> > keepITcool
> >

> > < homepage: http://members.chello.nl/keepitcool >
> >
> >

> >
> > > No that's just the problem, when I right click I should have the
> > > 'Custom' option but I only have the generic 'Properties' option. All
> > > very odd!
> > >

> > >
> > >> hmm...
> > >>
> > >> you're not confusing VB6 with VBA?
> > >>
> > >> in VB6 you go straight to the properties bag.
> > >> in VBA you need to click (Custom) in the Properties pane.
> > >>
> > >>
> > >> keepITcool
> > >>
> > >>

> > >>
> > >> > Hi,
> > >> >
> > >> > Yes, the library Microsoft Windows Common Controls 6.0 is
> > >> > referenced. To make sure, I've also re-registered the library in
> > >> > \\System32.
> > >> >
> > >>
> > >
> >
> >
 
 
DavidW





PostPosted: Thu Jul 01 05:12:01 CDT 2004 Top

Excel Programming >> Custom Properties Just one other question...........! Now that I've populated my ImageList I want to bind it to my TreeView control, however, when I access the ImageList combo on the Property page for the TreeView my ImageList is not listed, it has only one entry in the combo, the default <None>?!





> as i said..
>
> in VBA you should get the Properties option in the context popup.
>
> if you click that if sets the focus to the properties window and selects
> the control. (and opens the prop window it necessary)
>
> then in the properties window ..
> select the line with (custom)
> double click THAT.
>
> FAIK that's how it's always worked in VBA...
> (still think your confused with VB6)
>
> keepITcool
>

> < homepage: http://members.chello.nl/keepitcool >
>
>

>
> > No that's just the problem, when I right click I should have the
> > 'Custom' option but I only have the generic 'Properties' option. All
> > very odd!
> >

> >
> >> hmm...
> >>
> >> you're not confusing VB6 with VBA?
> >>
> >> in VB6 you go straight to the properties bag.
> >> in VBA you need to click (Custom) in the Properties pane.
> >>
> >>
> >> keepITcool
> >>
> >>

> >>
> >> > Hi,
> >> >
> >> > Yes, the library Microsoft Windows Common Controls 6.0 is
> >> > referenced. To make sure, I've also re-registered the library in
> >> > \\System32.
> >> >
> >>
> >
>
>
 
 
keepITcool





PostPosted: Thu Jul 01 05:46:43 CDT 2004 Top

Excel Programming >> Custom Properties David, you'll have to bind at runtime

assuming the listimage contains an image with the key "logo"
this works for me:

Private Sub UserForm_Initialize()
With TreeView1
Set .ImageList = Me.ImageList1
.Nodes.Add , , "node1", "oops", "logo"
End With
End Sub



keepITcool


< homepage: http://members.chello.nl/keepitcool >




>
> Just one other question...........! Now that I've populated my
> ImageList I want to bind it to my TreeView control, however, when I
> access the ImageList combo on the Property page for the TreeView my
> ImageList is not listed, it has only one entry in the combo, the
> default <None>?!
>

 
 
DavidW





PostPosted: Thu Jul 01 08:22:01 CDT 2004 Top

Excel Programming >> Custom Properties Guess what....I'm now getting an 'Invalid Object' error message! Here's the code I've added:

With trvMain
Set .ImageList = Me.ImageList1
End With

Help!!?!!



> David, you'll have to bind at runtime
>
> assuming the listimage contains an image with the key "logo"
> this works for me:
>
> Private Sub UserForm_Initialize()
> With TreeView1
> Set .ImageList = Me.ImageList1
> .Nodes.Add , , "node1", "oops", "logo"
> End With
> End Sub
>
>
>
> keepITcool
>

> < homepage: http://members.chello.nl/keepitcool >
>
>

>
> >
> > Just one other question...........! Now that I've populated my
> > ImageList I want to bind it to my TreeView control, however, when I
> > access the ImageList combo on the Property page for the TreeView my
> > ImageList is not listed, it has only one entry in the combo, the
> > default <None>?!
> >
>
>
 
 
keepITcool





PostPosted: Thu Jul 01 09:31:34 CDT 2004 Top

Excel Programming >> Custom Properties the ME keyword will only work in object modules.
(sheet code, userform etc)

so it's important to know WHERE your code is located

does trvMain exist?
is it a variable or a control?
does imageList1 exist?

if it's in a userform.. WHEN do you load it?
e.g. in which event..
has the form been initialized
has the form been activated
has the treeview been populated ??


hard to debug.. from a 3 line snippet :(


keepITcool


< homepage: http://members.chello.nl/keepitcool >




> Guess what....I'm now getting an 'Invalid Object' error message!
> Here's the code I've added:
>
> With trvMain
> Set .ImageList = Me.ImageList1
> End With
>
> Help!!?!!
>

>
>> David, you'll have to bind at runtime
>>
>> assuming the listimage contains an image with the key "logo"
>> this works for me:
>>
>> Private Sub UserForm_Initialize()
>> With TreeView1
>> Set .ImageList = Me.ImageList1
>> .Nodes.Add , , "node1", "oops", "logo"
>> End With
>> End Sub
>>
>>
>>
>> keepITcool
>>

>> < homepage: http://members.chello.nl/keepitcool >
>>
>>

>>
>> >
>> > Just one other question...........! Now that I've populated my
>> > ImageList I want to bind it to my TreeView control, however, when I
>> > access the ImageList combo on the Property page for the TreeView my
>> > ImageList is not listed, it has only one entry in the combo, the
>> > default <None>?!
>> >
>>
>>
>