Silverlight 拾取日期和時間的控制項-DateTimePicker

來源:互聯網
上載者:User

標籤:sliverlight   日期   時間   datetimepicker   

實現了一個Sliverlight可拾取時間和日期的控制項

先看產品使用時功能:

右側按鍵“...”點擊後的樣子


下方時間選擇後的樣子

本控制項失去焦點後自動彈回下拉框。


目前還存在一點小問題就是無法很好地通過鍵盤輸入編輯時間。


實現過程:

介面就是TextBox、Button、GlobalCalendar和TimePicker的組合使用


<UserControl xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"  x:Class="KJ24BS.Controls.DateTimePicker"    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"    xmlns:toolkit_input="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"    xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"    xmlns:BSConverter="clr-namespace:KJ24BS.Converters"    mc:Ignorable="d">    <StackPanel >        <StackPanel Orientation="Horizontal" >            <TextBox x:Name="_txtBoxDateTime" Width="124" />            <Button Content="..." Click="Button_Click"/>        </StackPanel>        <Popup x:Name="_popup" >            <Border x:Name="PopupRoot" BorderBrush="#FF8d8b8b" BorderThickness="1">                <StackPanel>                    <toolkit:GlobalCalendar x:Name="_calendar" HorizontalAlignment="Left" SelectionMode="SingleDate"  />                    <toolkit_input:TimePicker x:Name="_timePicker" HorizontalAlignment="Stretch"/>                </StackPanel>            </Border>        </Popup>    </StackPanel></UserControl>

後台實現有200多行,就提供給大家下載吧。

點擊開啟連結


Silverlight 拾取日期和時間的控制項-DateTimePicker

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.