Hi guys,

I have a problem with getting the activeselectionset. The code I have now is

Code:


PublicClassForm3
PublicSubNew()
' This call is required by the designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
Dim teller AsInteger
teller = 0
ForEach entitie In Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.AcadDocument.activeselectionset
teller = teller + 1
Next
LBLaantal.Text = teller
EndSub
PrivateSub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMe.Load
AddHandler Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor.SelectionAdded, AddressOf testform
AddHandler Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor.SelectionRemoved, AddressOf testform
EndSub
PublicSub testform()
 
Dim teller AsInteger
teller = 0
ForEach entitie In Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.AcadDocument.activeselectionset
teller = teller + 1
Next
LBLaantal.Text = teller
EndSub

EndClass
 
When the form is loaded the command with activeselectionset is working, but after the selection is changed the command with activeselectionset is not working.

Does anyone know what is wrong? Let me know.

Greetings

Rob