Limitations of windows forms
-
I am writing a mobile device program for my university coursework but I am coming up against a few problems or limitations, I am not sure which, the two problems which I am finding is that I do not have some functionality which I normally have when writing for normal windows forms. The two problems I have is when I try and assign an Enum to a combo box, Private Enum X //Set of enums End Enum ComboBox1.DataSource = Enum.GetValues(GetType(x)) I am finding that I am not able to uses the "GetValues" or "GetTypes" of the enum functionality, which means that I can’t populate the combo box correctly. This is also found when the ImageConverter function which exists for normal windows form but doesn't exists when writing for the mobile framework. Any help would be greatly appreciated.
-
I am writing a mobile device program for my university coursework but I am coming up against a few problems or limitations, I am not sure which, the two problems which I am finding is that I do not have some functionality which I normally have when writing for normal windows forms. The two problems I have is when I try and assign an Enum to a combo box, Private Enum X //Set of enums End Enum ComboBox1.DataSource = Enum.GetValues(GetType(x)) I am finding that I am not able to uses the "GetValues" or "GetTypes" of the enum functionality, which means that I can’t populate the combo box correctly. This is also found when the ImageConverter function which exists for normal windows form but doesn't exists when writing for the mobile framework. Any help would be greatly appreciated.
It is annoying but that is the limitations of the compact framework - Missing properties and methods so you have to be more creative! How about using a list as the source or failing that a generic routine to populate a combo box. Try posting in the Mobile forum. They may have more for you. Regards
The FoZ
-
I am writing a mobile device program for my university coursework but I am coming up against a few problems or limitations, I am not sure which, the two problems which I am finding is that I do not have some functionality which I normally have when writing for normal windows forms. The two problems I have is when I try and assign an Enum to a combo box, Private Enum X //Set of enums End Enum ComboBox1.DataSource = Enum.GetValues(GetType(x)) I am finding that I am not able to uses the "GetValues" or "GetTypes" of the enum functionality, which means that I can’t populate the combo box correctly. This is also found when the ImageConverter function which exists for normal windows form but doesn't exists when writing for the mobile framework. Any help would be greatly appreciated.
I've been able to do it by using AddRange
Array arr = System.Enum.GetValues(typeof(MyEnum));
object[] oArr = new object[arr.length];
arr.CopyTo(oArr, 0);
combobox1.Items.AddRange(arr);