Maxscript: MSComctlLib.ListViewCtrl doesn' work

My beginner problems & solutions

Moderator: Falk

Antworten
Simon
Site Admin
Beiträge: 1678
Registriert: 10.10.2006, 16:41

Maxscript: MSComctlLib.ListViewCtrl doesn' work

Beitrag von Simon »

MSComctlLib.ListViewCtrl seems to produce problems under newer max version & 64bit windows. Use dotNet! Good Tutorials how to the the ListView running:

http://paulneale.com/tutorials/dotNet/l ... ingColumns

http://blog.duber.cz/3ds-max/farewell-activex
{o,o}
|)__)
-"-"-
O RLY?
Simon
Site Admin
Beiträge: 1678
Registriert: 10.10.2006, 16:41

Re: Maxscript: MSComctlLib.ListViewCtrl doesn' work

Beitrag von Simon »

dotNetControl actx1 "System.Windows.Forms.ListView"

clear list
actx1.items.clear();
CAREFUL! CLEAR means, that listbox loses the selection & focus!

get selected items
entries = actx1.selectedIndices;
for t=0 to entries.count-1 do
...

get item
actx1.items.item[1].subitems.item[4].text

add item color
actx1.items.item[0].Backcolor = (dotNetClass "System.Drawing.Color").fromArgb 255 0 0

add subitem color
myItem = dotNetObject "System.Windows.Forms.ListViewItem" ""; --Vertexcolor
myItem.UseItemStyleForSubItems = false;
myItem.Backcolor = (dotNetClass "System.Drawing.Color").fromArgb vert[1] vert[2] vert[3];
submyItem = myItem.SubItems.add ""; --Illumination
submyItem.Backcolor = (dotNetClass "System.Drawing.Color").fromArgb illum[1] illum[2] illum[3];
{o,o}
|)__)
-"-"-
O RLY?
Antworten