栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > asp

高仿Windows Phone QQ登录界面实例代码

asp 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

高仿Windows Phone QQ登录界面实例代码

给 TextBox文本框前添加图片

扩展PhoneTextBox:添加一个类“ExtentPhoneTextBox”继承 PhoneTextBox ,在“ExtentPhoneTextBox”类中添加属性项:
复制代码 代码如下:
public class ExtentPhoneTextBox : PhoneTextBox
    {
        ///


        /// 文本框图片属性
        ///

        public static readonly DependencyProperty TextHeadImageProperty =
            DependencyProperty.Register("TextHeadImage", typeof(ImageSource), typeof(ExtentPhoneTextBox), new Propertymetadata(null)
            );

        ///


        /// 文本框头图片
        ///

        public ImageSource TextHeadImage
        {
            get { return base.GetValue(TextHeadImageProperty) as ImageSource; }
            set { base.SetValue(TextHeadImageProperty, value); }
        }

        ///


        /// 文本图片宽度
        ///

        public double TextHeadImageWidth
        {
            get { return (double)GetValue(TextHeadImageWidthProperty); }
            set { SetValue(TextHeadImageWidthProperty, value); }
        }

        // Using a DependencyProperty as the backing store for TextHeadImageWidth.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty TextHeadImageWidthProperty =
            DependencyProperty.Register("TextHeadImageWidth", typeof(double), typeof(ExtentPhoneTextBox), new Propertymetadata(null));

        ///


        /// 文本图片高度
        ///

        public double TextHeadImageHeight
        {
            get { return (double)GetValue(TextHeadImageHeightProperty); }
            set { SetValue(TextHeadImageHeightProperty, value); }
        }

        // Using a DependencyProperty as the backing store for TextHeadImageHeight.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty TextHeadImageHeightProperty =
            DependencyProperty.Register("TextHeadImageHeight", typeof(double), typeof(ExtentPhoneTextBox), new Propertymetadata(null));
    }
}

ExtentPhoneText 样式编辑:

全部样式如下:
复制代码 代码如下:

           
               
                   
               

           

       

       
       
           
           
           
           
           
           
           
           
           
           
           
               
                   
                       
                           
                               
                               
                           

                           
                               
                                   
                                   
                                       
                                           
                                               
                                           

                                           
                                               
                                           

                                           
                                               
                                           

                                           
                                               
                                           

                                       

                                   

                                   
                                       
                                           
                                               
                                                   
                                                        Collapsed
                                                   

                                               

                                           

                                           
                                               
                                                   
                                                        Visible
                                                   

                                               

                                           

                                           
                                               
                                           

                                           
                                               
                                           

                                           
                                               
                                           

                                       

                                   

                               

                               
                                   
                                       
                                           
                                               
                                           

                                           
                                               
                                           

                                       

                                   

                                   
                               

                               
                                   
                                       
                                           
                                               
                                                   
                                                       
                                                            Visible
                                                       

                                                   

                                               

                                               
                                                   
                                               

                                               
                                                   
                                               

                                               
                                                   
                                                       
                                                   

                                               

                                           

                                       

                                       
                                           
                                               
                                                   
                                                       
                                                   

                                               

                                               
                                                   
                                               

                                               
                                                   
                                               

                                               
                                                   
                                                       
                                                            Collapsed
                                                       

                                                   

                                               

                                           

                                       

                                   

                                   
                                       
                                           
                                               
                                                   
                                                        Visible
                                                   

                                               

                                           

                                           
                                               
                                           

                                           
                                               
                                           

                                           
                                       

                                   

                                   
                               

                           

                           
                           
                               
                                   
                                       
                                   

                               

                           

                           
                               
                           

                           
                           
                               
                                   
                                   
                               

                           

                           
                               
                                   
                               

                           

                           
                       

                   

               

           

       

UI部局xaml代码如下:

            Margin="0,162,24,19"
            Grid.RowSpan="2">

                            TextWrapping="Wrap"
                VerticalAlignment="Top"
                PlaceholderText="QQ号码/手机/邮箱"
                Height="80"
                Background="White" TextHeadImage="/Assets/QqAccount.WVGA.png" Style="{StaticResource ExtentPhoneTextBoxStyle}" TextHeadImageHeight="22" TextHeadImageWidth="24" />
                            TextWrapping="Wrap"
                VerticalAlignment="Top"
                PlaceholderText="点击输入QQ密码"
                Height="80"
                Background="White" Style="{StaticResource ExtentPhoneTextBoxStyle}" TextHeadImage="/Assets/Password.WVGA.png" TextHeadImageHeight="22" TextHeadImageWidth="24" />

                            HorizontalAlignment="Left"
                Margin="12,195,0,0"
                VerticalAlignment="Top"
                HorizontalContentAlignment="Left" />
                            HorizontalAlignment="Left"
                Margin="224,195,0,0"
                VerticalAlignment="Top" />
                            HorizontalAlignment="Left"
                Margin="12,272,0,0"
                VerticalAlignment="Top" />
                            HorizontalAlignment="Left"
                Margin="12,349,0,0"
                VerticalAlignment="Top"
                HorizontalContentAlignment="Left" />
                            HorizontalAlignment="Left"
                Margin="12,385,0,0"
                VerticalAlignment="Top"
                HorizontalContentAlignment="Left" />

       
运行效果如下:

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/57355.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号