|
-
February 17th, 2000, 09:14 AM
#1
Interesting problem (kind of)...
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?
-------------------------
Nick A.
-
February 17th, 2000, 09:27 AM
#2
Re: Interesting problem (kind of)...
you could try to use the Listview instead of a listbox.
It is more flexible as far as sorting is concerned.
You can achieve the same visible results, by using the Report mode.
-
February 17th, 2000, 09:43 AM
#3
Re: Interesting problem (kind of)...
It IS a way to help me bypass this problem - and thank you for that - but it's not a solution to the problem. I wonder if they (MS) have ever thought of this...
-------------------------
Nick A.
-
February 17th, 2000, 09:46 AM
#4
Re: Interesting problem (kind of)...
>I wonder if they (MS) have ever thought of this...
in my opinion the listbox control is simply "old".
Even if you use a listbox "the API way", you have to set the LBS_SORT style bit upon creation of the listbox window and cannot change that after the window has been created, AFAIK.
-
February 17th, 2000, 10:03 AM
#5
Re: Interesting problem (kind of)...
Well then, maybe it's the right time to stop using it...
Thanks for the tips.
-------------------------
Nick A.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|