Repository: beeware/toga

Issue:
Selection "value" property set does not work in windows
## Expected Behavior
toga support setting the `value` property of `Selection` from code as:
```python
selection.value = value
```
consider the following app:
```python
class ExampleApp(toga.App):

    OPTIONS = ["a" , "b", "c", "d"]

    def startup(self):
        # Set up main window
        self.main_window = toga.MainWindow(title=self.name)

        # Outermost box
        box = toga.Box(
            style=Pack(
                flex=1,
                direction=COLUMN
            )
        )

        box.add(toga.Label(text="HI", style=Pack(text_align=CENTER,
                                                 alignment=BOTTOM)))
        self.selection = toga.Selection(items=self.OPTIONS, on_select=self.select)
        box.add(self.selection)
        box.add(toga.Button(label="Push me", on_press=self.push))

        # Add the content on the main window
        self.main_window.content = box

        # Show the main window
        self.main_window.show()

    def select(self, widget):
        print("Hi From Select!")

    def push(self, widget):
        print("Hi from push!")
        self.selection.value = "c"
```

The main window looks like:

![toga](https://user-images.githubusercontent.com/19425795/79901128-053a2680-8418-11ea-8c4e-f153a582d4d2.png)

When pressing the "Push me" button, the value in the selection should be "c". In reality, The value stays the same in windows...

## Steps to reproduce
1. Copy the app

2. Run in windows

3. See what happens


## Your Environment
* Python Version - 3.7
  - [ ] macOS - version:
  - [ ] Linux - distro:   - version:
  - [V] Windows - version: Windows 10
  - [ ] Other - name:  - version:

* Toga Version (list the specific version number or git hash) latest

* Toga Target (the type of app you are trying to generate)

  - [ ] android
  - [ ] cocoa
  - [ ] django
  - [ ] gtk
  - [ ] iOS
  - [ ] tvOS
  - [ ] watchOS
  - [v] winforms
  - [ ] win32
  - [ ] Other (please specify)



Discussion:

Resolving patch:
diff --git a/examples/selection/selection/app.py b/examples/selection/selection/app.py
--- a/examples/selection/selection/app.py
+++ b/examples/selection/selection/app.py
@@ -2,7 +2,12 @@
 from toga.style import Pack
 from toga.constants import COLUMN, ROW
 
+
 class SelectionApp(toga.App):
+    CARBON = "Carbon"
+    YTTERBIUM = "Ytterbium"
+    THULIUM = "Thulium"
+    OPTIONS = [CARBON, YTTERBIUM, THULIUM]
 
     def startup(self):
         # Main window of the application with title and size
@@ -13,54 +18,96 @@ def startup(self):
         box_style = Pack(direction=ROW, padding=10)
 
         # Add the content on the main window
+        self.selection = toga.Selection(items=self.OPTIONS)
+
         self.main_window.content = toga.Box(
             children=[
-                toga.Box(style=box_style, children=[
-                    toga.Label("Select an element",
-                        style=label_style),
-
-                    toga.Selection(items=["Carbon", "Ytterbium", "Thulium"])
-                ]),
-
-                toga.Box(style=box_style, children=[
-                    toga.Label("use the 'on_select' callback to respond to changes",
-                        style=label_style),
-
-                    toga.Selection(
-                      on_select=self.my_on_select,
-                      items=["Dubnium", "Holmium", "Zirconium"])
-
-                ]),
-
-                toga.Box(style=box_style, children=[
-                    toga.Label("Long lists of items should scroll",
-                        style=label_style),
-
-                    toga.Selection(items=dir(toga)),
-                ]),
-
-                toga.Box(style=box_style, children=[
-                    toga.Label("use some style!", style=label_style),
-
-                    toga.Selection(
-                        style=Pack(width=200, padding=24),
-                        items=["Curium", "Titanium", "Copernicium"])
-                ]),
-
-                toga.Box(style=box_style, children=[
-                    toga.Label("Selection widgets can be disabled", style=label_style),
-
-                    toga.Selection(
-                        items=['Helium', 'Neon', 'Argon', 'Krypton', 'Xenon', 'Radon', 'Oganesson'],
-                        enabled=False
-                    )
-                ]),
+                toga.Box(
+                    style=box_style,
+                    children=[
+                        toga.Label("Select an element", style=label_style),
+                        self.selection,
+                    ],
+                ),
+                toga.Box(
+                    style=box_style,
+                    children=[
+                        toga.Label(
+                            "Selection value can be set by property setter",
+                            style=label_style,
+                        ),
+                        toga.Button(label="Set Carbon", on_press=self.set_carbon),
+                        toga.Button(label="Set Ytterbium", on_press=self.set_ytterbium),
+                        toga.Button(label="Set THULIUM", on_press=self.set_thulium),
+                    ],
+                ),
+                toga.Box(
+                    style=box_style,
+                    children=[
+                        toga.Label(
+                            "use the 'on_select' callback to respond to changes",
+                            style=label_style,
+                        ),
+                        toga.Selection(
+                            on_select=self.my_on_select,
+                            items=["Dubnium", "Holmium", "Zirconium"],
+                        ),
+                    ],
+                ),
+                toga.Box(
+                    style=box_style,
+                    children=[
+                        toga.Label(
+                            "Long lists of items should scroll", style=label_style
+                        ),
+                        toga.Selection(items=dir(toga)),
+                    ],
+                ),
+                toga.Box(
+                    style=box_style,
+                    children=[
+                        toga.Label("use some style!", style=label_style),
+                        toga.Selection(
+                            style=Pack(width=200, padding=24),
+                            items=["Curium", "Titanium", "Copernicium"],
+                        ),
+                    ],
+                ),
+                toga.Box(
+                    style=box_style,
+                    children=[
+                        toga.Label(
+                            "Selection widgets can be disabled", style=label_style
+                        ),
+                        toga.Selection(
+                            items=[
+                                "Helium",
+                                "Neon",
+                                "Argon",
+                                "Krypton",
+                                "Xenon",
+                                "Radon",
+                                "Oganesson",
+                            ],
+                            enabled=False,
+                        ),
+                    ],
+                ),
             ],
-            style=Pack(direction=COLUMN, padding=24)
+            style=Pack(direction=COLUMN, padding=24),
         )
 
         self.main_window.show()
 
+    def set_carbon(self, widget):
+        self.selection.value = self.CARBON
+
+    def set_ytterbium(self, widget):
+        self.selection.value = self.YTTERBIUM
+
+    def set_thulium(self, widget):
+        self.selection.value = self.THULIUM
+
     def my_on_select(self, selection):
 
         # get the current value of the slider with `selection.value`
@@ -70,4 +117,4 @@ def my_on_select(self, selection):
 
 def main():
     # App name and namespace
-    return SelectionApp('Selection', 'org.beeware.selection')
+    return SelectionApp("Selection", "org.beeware.selection")
diff --git a/src/winforms/toga_winforms/widgets/selection.py b/src/winforms/toga_winforms/widgets/selection.py
--- a/src/winforms/toga_winforms/widgets/selection.py
+++ b/src/winforms/toga_winforms/widgets/selection.py
@@ -32,7 +32,7 @@ def add_item(self, item):
 
     def select_item(self, item):
         index = self.native.FindString(item)
-        self.native.SelectedItem = index
+        self.native.SelectedIndex = index
 
     def get_selected_item(self):
         return self.native.SelectedItem


Test patch: