0

我正在用 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 秒。然后出现窗口的其余部分。如何防止日期时间选择器提前出现?

我提前感谢您的帮助。

极客

4

0 回答 0