Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Controls question 2

Status
Not open for further replies.

RonRepp

Technical User
Feb 25, 2005
1,031
US
Hi all:

For some reason, I have a treeview and an imagelilst control, and I cannot connect the two.

I've tried using both the property pages and doing it in code (TV1.ImageList=ImageList1)

Any thoughts?

Thanks,

Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.

My newest novel: Wooden Warriors
 



Hi,

What Application?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Sorry, Skip...

2003, but I've also tried in 2007 and come up with the same thing.

If I do the same thing in VB6, it works fine.

Any suggestions?

Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.

My newest novel: Wooden Warriors
 


Hellooooo.

What APPLICATION.

Not what version of Windows or Office!

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Excel.

Sorry...it's been a longgggggggg time since I've done VBA...and almost as long since posting here.

I forgot proper etiquette.

Using Wndows Forms 2.0.

Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.

My newest novel: Wooden Warriors
 
In VBA it's possible only by code, and it should work:
[tt]TV1.ImageList=ImageList1[/tt]
You need assign the imagelist every time the userform is initialised.

combo
 
combo:

I have that already:

Code:
Private Sub UserForm_Initialize()
    DBQ = ReturnString(QFile)
    TV1.ImageList = Me.ImageList1
    ShowTables
    
End Sub

Could it have something to do with the fact that I have both 2003 and 2007 installed?



Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.

My newest novel: Wooden Warriors
 
What do you mean by "...and I cannot connect the two"? Can you assign (by code) an icon to the node? Any error message? Have you tried with different icon sizes? Can you post an example code (filling node)?

combo
 
Combo:

I receive no error codes, but I get no pics.

I use the exact same code in a VB6 form, and it works fine, so I know it's not the code.

I didn't have this problem before I moved to Vista...figures.

Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.

My newest novel: Wooden Warriors
 
Sorry if this is obvious, but check if reference is valid, macros enabled.
For me this works (excel 2003, Microsoft Windows Common Controls (SP6)):
Code:
Private tvNodeRoot As MSComctlLib.Node

Private Sub UserForm_Initialize()
With Me.tvExample
    .ImageList = Me.imlImages
    Set tvNodeRoot = .Nodes.Add(relationship:=tvwFirst, Key:="R", Text:="RootName", Image:=1)
End With
End Sub

combo
 
Combo:

It was a good thought using the full control, but it still didn't work.

I think it's because I added 2003 after the fact and should probably uninstall and then reinstall.

Come to think about it, I think I'll send it to my wife's PC and have a crack @ it there.

Thanks for your time,

Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.

My newest novel: Wooden Warriors
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top