我在xaml页面中加入一个ComboBox控件,并添加了ComboBoxItem项,代码如下:
<ComboBox Width="60" Height="25" x:Name="cbCycle" SelectionChanged="cbCycle_SelectionChanged">
<ComboBoxItem Content="每天" IsSelected="True"></ComboBoxItem>
<ComboBoxItem Content="每周" ></ComboBoxItem>
<ComboBoxItem Content="每月" ></ComboBoxItem>
</ComboBox>
cbCycle.Items.Add("按天");
cbCycle.Items.Add("按周");
cbCycle.Items.Add("按月");