0

ここで私はwpfカレンダーコントロールで立ち往生しています.WPFでカレンダーコントロールを使用していますが、好きなGotFocusイベントでそれを呼び出すとTextBox

private void txtjobdate_GotFocus(object sender, RoutedEventArgs e)
        {
            calendar1.Visibility = Visibility.Visible;
        }

次のような他のコントロールの背後に常に表示されます ここに画像の説明を入力

xaml コード

<Window x:Class="PhotoSaver.PhotoGraphyJob_Management.AddEditPhotoGraphyJob"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="AddEditPhotoGraphyJob" Height="387" Width="511" xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors">
    <Grid>
        <GroupBox>
            <GroupBox.Header>
                <Label>PhotoGraphy Job</Label>
            </GroupBox.Header>
            <Calendar Height="170"  Name="calendar1" Width="180" Visibility="Hidden" SelectedDatesChanged="calendar1_SelectedDatesChanged" AllowDrop="True" />
        </GroupBox>
        <dxlc:LayoutItem Label="Job Name" Margin="92,39,149,0" Name="JobName" Height="20" VerticalAlignment="Top" LabelPosition="Left" LabelHorizontalAlignment="Center" LabelVerticalAlignment="Center" ElementSpace="5" >
            <dxe:TextEdit Name="txtjobname" />
        </dxlc:LayoutItem>
        <dxlc:LayoutItem Label="Job Date" Margin="96,78,149,0" Name="JobDate" Height="20" VerticalAlignment="Top" LabelPosition="Left" LabelHorizontalAlignment="Center" LabelVerticalAlignment="Center" ElementSpace="5" >
            <dxe:TextEdit Name="txtjobdate" DataContext="{Binding}" GotFocus="txtjobdate_GotFocus" />
        </dxlc:LayoutItem>

        <dxlc:LayoutItem Label="Image Folder" Margin="75,117,149,0" Name="ImageFolder" Height="20" VerticalAlignment="Top" LabelPosition="Left" LabelHorizontalAlignment="Center" LabelVerticalAlignment="Center" ElementSpace="5" >
            <dxe:TextEdit Name="txtimagefolder" />
        </dxlc:LayoutItem>
        <Button Content="Browse" Height="23" HorizontalAlignment="Left" Margin="356,114,0,0" Name="Browse" VerticalAlignment="Top" Width="75" Click="Browse_Click" />
        <Button Content="Update" Height="23" HorizontalAlignment="Left" Margin="151,181,0,0" Name="Update" VerticalAlignment="Top" Width="75" Panel.ZIndex="1" />
        <Button Content="Clear" Height="23" HorizontalAlignment="Left" Margin="265,181,0,0" Name="Clear" VerticalAlignment="Top" Width="75" />
    </Grid>
</Window>

他のコントロールの上にカレンダー コントロールを表示することで、この問題を解決する方法を教えてください。

皆さんが私の質問を理解し、私を導いてくれることを願っています。

前もって感謝します。

4

1 に答える 1

0

1) カレンダー オブジェクトを右クリック --> [順序] --> [前面に移動] を選択します。

2) または、GroupBox アイテムを宣言内の一番下に移動するだけです <Grid>(z オーダーは一番下 (最高) から一番上 (最低) です)。少し直感に反するかもしれません。

于 2013-06-13T10:14:00.017 に答える