how to make index counter

how to make index counter

Anonymous
Not applicable
246 Views
1 Reply
Message 1 of 2

how to make index counter

Anonymous
Not applicable
how to make index counter for listbox, starting 0 1 2... and so on, let say for layers dim LayerName as Acadlayer dim Index as Integer for each LayerName in thisdrawing.layers ListBox1.Additem LayerName.Name index = index + 1 ;this is right way ...... ...... next end sub
0 Likes
247 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
something like this.... Dim objLayer As AcadLayer Dim j As Integer: j = 0 For Each objLayer In ThisDrawing.Layers ListBox1.AddItem Str(j) + ": " + objLayer.Name j = j + 1 Next objLayer cheers... wrote in message news:4154cee5$1_2@newsprd01... > how to make index counter for listbox, starting 0 1 2... and so on, > let say for layers > > dim LayerName as Acadlayer > dim Index as Integer > for each LayerName in thisdrawing.layers > ListBox1.Additem LayerName.Name > index = index + 1 ;this is right way > ...... > ...... > next > > end sub > > >
0 Likes