Вопрос

Probably a simple question, but still a mystery:

Error: 'System.Windows.Forms.ListBox' does not contain a definition for 'DrawMode' ...

How is this possible? Yesterday I tinkered with DrawMode and made a great listbox. Now in the same Visual Studio 2008 environment, but different project, this error. ListBox.SelectedItem etc is available, why not .DrawMode ??? I do have 'using System.Windows.Forms;' in my source.


OK This is what I found in the microsoft manual:

The .NET Compact Framework does not support the DrawMode, DrawItem, and other drawing members for list box and other controls, but you can program that functionality.

I am back into programming.

Это было полезно?

Решение

You have probably created the wrong kind of project.

For example, System.Windows.Controls.ListBox doesn't contain a DrawMode property.

Другие советы

You probably confused System.Windows.Forms.ListBox from windows forms with the one from asp.net webforms System.Web.UI.WebControls.ListBox or the one of WPF System.Windows.Controls.ListBox (which both do not have that property).

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top