About consistency

  • Thread starter Thread starter John Smith
  • Start date Start date
J

John Smith

About consistency

ListBox/ComboBox.SelectedIndex returns an Integer
why does ListBox/ComboBox.SelectedIndices return a SelectedIndexCollection?
should return an Integer()

you can use ListBox/ComboBox.Items.AddRange(many types)
why does ListBox/ComboBox.SelectedItems return only a
SelectedObjectCollection?
should return the type used to set the items
is it easier to set items as objects and write your own sort method just
to show the DisplayNames?

Most Controls have an AllowDrop property, where is the AllowDrag property?

hmmm, you can add a few more :)


I love VB, simple and useful!
Microsoft can do it!
Keep VB attached to the operating system and improve it, don't change it!
 
Hi John,

DotNet is one big inherited box.

Most controls as listbox and combobox are direct or indirect inherited from
controls (forms is also).

Therefore, to understand it all down you have to start at the parent class.

However, it uses also polymorphism. When you will look at the textbox, you
will see that although the most derived controls use text the standard
property the textbox uses an overridden property.

What you will see as result of this is very consistent behaviour, but like
in nature, a dog and cat have differences.

I hope this makes it clearer,

Cor
 
Let Add one more

Split("",",") returns an array with one element = ""
Should return Nothing
 
Back
Top