I'm just learning WPF apps and have been looking for a good tutorial on how variables work within the WPF model, but really haven't been able to find something. Subsequently, I'm a bit stuck :S
I feel like I'm trying to do something basic here, but maybe I'm just off my rocker. All I'm trying to do is onSelectionChanged of a dropdown, run function XXX. Function XXX, at run, populates a variables then writes the variable to a label. I'll post code snippets. But what am I missing?
DropDown Code
Dropdown Handler CodeCode:<ComboBox Canvas.Left="223" Canvas.Top="261" Height="23" Name="userTempScale" Width="54" Background="{x:Null}" BorderBrush="#FF992907" BorderThickness="0" Foreground="#FF992907" HorizontalContentAlignment="Center"> <ComboBoxItem Content="F" IsSelected="True" /> <ComboBoxItem Content="C" /> <ComboBoxItem Content="K" /> <ComboBoxItem Content="Re" /> <ComboBoxItem Content="Ra" /> </ComboBox>
Function XXX codeCode:Private Sub userTempScale_SelectionChanged(ByVal sender As Object, ByVal e As System.Windows.Controls.SelectionChangedEventArgs) Handles userTempScale.SelectionChanged calculateTemps() ' Update our Temps End Sub
Like I said, pretty basic but I seem to be missing a connection between WPF and WinForms. Anyone got a wrench to smack me over the head with?Code:Public Function calculateTemps() As Action Dim tempscale As String = userTempScale.SelectedItem.ToString If tempscale = "F" Then fah_label.Content = tempscale endif![]()




Reply With Quote