我想將此轉換爲uint就像這個轉換爲字符串?如何轉換爲uint?
Formation = comboBox2.SelectedItem == null ? "Any" : (comboBox2.SelectedItem as ComboboxItem).Value.ToString(),
League = comboBox3.SelectedItem == null ? "Any" : (comboBox3.SelectedItem as ComboboxItem)
要放什麼,就像Value.toString()
得到uint?
'comboBox3.SelectedItem'是'uint'? –
您正在使用三元運算符,其中兩個可能的返回值必須是相同的類型。 「Any」不會很好轉換爲UInt ;-) – Bridge
'uint.Parse(str)' – I4V