I have tried the following code:

private withevents lstDVList as ListBox

set lstDVList = Controls.Add("VB.ListBox", "lstDVList")
lstDVList.Top = 300
lstDVList.Left = 300
lstDVList.Width = 4000
lstDVList.Height = 4000
lstDVList.ZOrder
lstDVList.Visible = true



It works fine. It adds a listbox in my form dynamically.

Now, if i try to put the following line (before or after the SET, makes no difference )
lstDVList.Sorted = true


VB does not let me. It says "cannot assign to read-only property", which is logical because you are allowed to set this property only in design time.

If i may ask, how am i supposed to set this property? Anyone has any ideas?