我正在使用C#WPF .NET 3.5开发一个程序。我有一个窗口,我在其中添加了日期时间选择器,如下所示:
<Window x:Class="ProcessData"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
Style="{StaticResource CustomWindow}"
Title="Process Data" Height="739" Width="576" WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize">
<Grid>
<Button HorizontalAlignment="Right" Margin="0,521,14,0" Name="buttonProcess" Width="106.5" Height="32" VerticalAlignment="Top" Click="buttonProcess_Click">Process</Button>
<Label Height="28" HorizontalAlignment="Left" Margin="16,597,0,0" Name="labelDateAndTime" VerticalAlignment="Top" Width="120">Date and time</Label>
<WindowsFormsHost Height="26" HorizontalAlignment="Left" Margin="16,625,0,0" Name="windowsFormsHostDateAndTime" VerticalAlignment="Top" Width="191">
<wf:DateTimePicker x:Name="dtpickerDateAndTime" Format="Custom" CustomFormat="MM/dd/yyyy hh:mm:ss tt"></wf:DateTimePicker>
</WindowsFormsHost>
</Grid>
我添加了Loaded事件处理程序,在其中我做了一些与UI相关的处理5-6秒。启动窗口时,首先出现日期时间选择器并保持5-6秒。然后出现窗口的其余部分。如何防止日期时间选择器提前出现?
我事先感谢你的帮助。
geekowl