Click here to Skip to main content
15,905,229 members
Home / Discussions / C#
   

C#

 
GeneralHowTo change color on statusbar Pin
QzRz7-Jul-04 9:54
QzRz7-Jul-04 9:54 
GeneralRe: HowTo change color on statusbar Pin
Heath Stewart7-Jul-04 12:50
protectorHeath Stewart7-Jul-04 12:50 
Generalproblem with SQLServer CE Pin
JulienR7-Jul-04 8:51
JulienR7-Jul-04 8:51 
GeneralRe: problem with SQLServer CE Pin
Heath Stewart7-Jul-04 12:56
protectorHeath Stewart7-Jul-04 12:56 
GeneralRe: problem with SQLServer CE Pin
Anonymous8-Jul-04 2:30
Anonymous8-Jul-04 2:30 
GeneralRe: problem with SQLServer CE Pin
Heath Stewart8-Jul-04 3:12
protectorHeath Stewart8-Jul-04 3:12 
GeneralCustom Listbox controls Pin
kam33mitch7-Jul-04 8:08
kam33mitch7-Jul-04 8:08 
GeneralRe: Custom Listbox controls Pin
Heath Stewart7-Jul-04 13:04
protectorHeath Stewart7-Jul-04 13:04 
Use ListBox.Items.Insert(0, someObject); instead of Add, which will always add the object to the end of the collection.

Unfortunately, even if you were to extend ListBox and override CreateItemCollection, you would not be able to override Add. It is not virtual and since all references to Item refer to the actual ListBox+ObjectCollection type, your Add (if you were to hide (Shadow in VB.NET) the existing Add) would not be called. Additionally, both ListBox+ObjectCollection.Add and ListBox+ObjectCollection.Insert call ListBox.NativeInsert, which is a private member you can't do anything about.

Perhaps not the best solution, but your only other option besides calling Insert(0, someObject) is to use another control - possibly a third-party control or one that you would write from scratch.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: Custom Listbox controls Pin
kam33mitch7-Jul-04 14:40
kam33mitch7-Jul-04 14:40 
Questionbitmap to byte array ? Pin
kendao7-Jul-04 7:10
kendao7-Jul-04 7:10 
AnswerRe: bitmap to byte array ? Pin
Grimolfr7-Jul-04 8:05
Grimolfr7-Jul-04 8:05 
AnswerRe: bitmap to byte array ? Pin
Heath Stewart7-Jul-04 8:50
protectorHeath Stewart7-Jul-04 8:50 
GeneralProgress Bar in Status bar panel Pin
bouli7-Jul-04 4:38
bouli7-Jul-04 4:38 
GeneralRe: Progress Bar in Status bar panel Pin
Heath Stewart7-Jul-04 5:55
protectorHeath Stewart7-Jul-04 5:55 
GeneralRe: Progress Bar in Status bar panel Pin
bouli7-Jul-04 23:52
bouli7-Jul-04 23:52 
GeneralRe: Progress Bar in Status bar panel Pin
Heath Stewart8-Jul-04 3:16
protectorHeath Stewart8-Jul-04 3:16 
GeneralRe: Progress Bar in Status bar panel Pin
bouli8-Jul-04 22:08
bouli8-Jul-04 22:08 
GeneralRe: Progress Bar in Status bar panel Pin
Gary Thom7-Jul-04 5:58
Gary Thom7-Jul-04 5:58 
GeneralRe: Progress Bar in Status bar panel Pin
bouli7-Jul-04 23:53
bouli7-Jul-04 23:53 
GeneralRe: Progress Bar in Status bar panel Pin
Gary Thom8-Jul-04 0:10
Gary Thom8-Jul-04 0:10 
Questionhow does this exception happened Pin
noosword7-Jul-04 2:58
noosword7-Jul-04 2:58 
AnswerRe: how does this exception happened Pin
Heath Stewart7-Jul-04 5:49
protectorHeath Stewart7-Jul-04 5:49 
GeneralRe: how does this exception happened Pin
Anonymous7-Jul-04 17:19
Anonymous7-Jul-04 17:19 
GeneralRe: how does this exception happened Pin
Heath Stewart8-Jul-04 3:01
protectorHeath Stewart8-Jul-04 3:01 
GeneralRe: how does this exception happened Pin
noosword8-Jul-04 17:52
noosword8-Jul-04 17:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.