你好,我不知道如何设置默认选择的字段 这是我的代码:
<DockPanel>
<Grid DockPanel.Dock="Left" Height="426">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="63"/>
<RowDefinition Height="79"/>
</Grid.RowDefinitions>
<Label Foreground="blue" Margin="0,1,0,4" Height="26">Message Number:</Label>
<Label Grid.Row="1" Foreground="blue" Margin="0 10 0 0">Title:</Label>
<Label Grid.Row="2" Foreground="blue" >Message Date:</Label>
<Label Grid.Row="3" Foreground="blue" Margin="0 10 0 0">Contact Mail:</Label>
<Label Grid.Row="4" Foreground="blue" Margin="0 10 0 0">Message Type:</Label>
<Label Grid.Row="5" Foreground="blue" Margin="0 10 0 0">Message Details:</Label>
<Button Grid.Row="6" Name="saveBtn" Background="White" Margin="6,20,11,36" Width="89" Click="saveBtn_Click">Save</Button>
<TextBox Grid.Column="1" Name="IDtbx" Margin="0 10 0 0"></TextBox>
<TextBox Grid.Row="1" Grid.Column="1" Name="titletbx" Margin="0 10 0 0"></TextBox>
<Calendar Grid.Row="2" Grid.Column="1" Name="calender"></Calendar>
<TextBox Grid.Row="3" Grid.Column="1" Name="mailtbx" Margin="0 10 0 0"></TextBox>
<ComboBox Grid.Row="4" Grid.Column="1" Name="typecbx" Margin="0 10 0 0"></ComboBox>
<TextBox Grid.Row="5" Grid.Column="1" Name="detailstbx" Margin="0,10,0,1" TextWrapping="Wrap" AcceptsReturn="True"></TextBox>
</Grid>
<DockPanel>
<Grid DockPanel.Dock="Left" Height="406">
<Grid.RowDefinitions>
<RowDefinition Height="372"></RowDefinition>
<RowDefinition Height="7"/>
<RowDefinition Height="27*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Border CornerRadius="6" BorderBrush="Purple" BorderThickness="3" Margin="18,8,0,7" Grid.RowSpan="2" Width="182">
<Image Grid.Row="1" Name="messageImage" Height="359" Width="177"></Image>
</Border>
<Button Name="ChangeImagebtn" Background="white" Content="Change Image" Grid.Row="2" Margin="21,2,0,-2" Click="ChangeImagebtn_Click"></Button>
</Grid>
</DockPanel>
</DockPanel>
当我运行程序时,出于某种原因选择了保存按钮,我不希望它出现。 在此先感谢您的帮助