UWP 圆角TextBox和PassWord框
2024-08-31 21:20:05
最近在做一个UWP项目,登录的用户和密码框需要圆角的,由于UWP的TextBlock 和PasswordBox是没有CornerRadius属性的,于是我就使用了一个Border嵌套在最外层,设置其他CornerRadius="20"
实现代码如下:
<!--账号-->
<Border Background="#FFFFFF" CornerRadius="">
<RelativePanel Margin="10,0,0,0" Padding="">
<TextBlock x:Name="tbNumber" Text="账号:" RelativePanel.AlignVerticalCenterWithPanel="True" />
<TextBox x:Name="txtUserName" FontSize="" RelativePanel.RightOf="tbNumber" PlaceholderText="请输入GW号/手机号"
RelativePanel.AlignRightWithPanel="True"
RelativePanel.AlignHorizontalCenterWithPanel="True"
RelativePanel.AlignVerticalCenterWithPanel="True"
Margin="0,5,0,0"
BorderThickness=""
InputScope="NameOrPhoneNumber"/>
</RelativePanel>
</Border>
<!--密码-->
<Border Background="#FFFFFF" CornerRadius="" Margin="0,20,0,0">
<RelativePanel Margin="10,0,0,0" Padding="">
<TextBlock x:Name="tbPwd" Text="密码:" RelativePanel.AlignVerticalCenterWithPanel="True" />
<PasswordBox x:Name="txtPwd" RelativePanel.RightOf="tbPwd" PlaceholderText="请输入密码"
RelativePanel.AlignRightWithPanel="True" IsEnabled="True"
BorderThickness=""
RelativePanel.AlignHorizontalCenterWithPanel="True"
RelativePanel.AlignVerticalCenterWithPanel="True"
Margin="0,5,0,0"/>
</RelativePanel>
</Border>
效果图如下:
UWP小白一个,欢迎指教!!
最新文章
- Dojo: Quick Start
- [原创]cocos2d-x研习录-第三阶 背景音乐和音效
- Linux 网络编程(UDP)
- [转]nodejs npm常用命令
- CMake入门以及学习笔记
- 2014年国人开发的最热门的开源软件TOP 100
- JS练习题1共7题
- 安装多JDK后,java编译环境和运行环境版本(JDK版本) 不一致解决:
- Add mappings to an Elasticsearch index in realtime
- Activity的窗口对象(Window)的创建过程分析
- C++初始化列表问题
- 1203.2——条件语句 之 switch语句
- windows下安装testlink
- JSP内置对象--pageContext对象(非常重要!!!)
- 设计模式的征途—2.简单工厂(Simple Factory)模式
- Array类的Sort()方法
- js中定义对象的几种方式
- IPFS: BitSwap协议(数据块交换)
- 【转】使用ffmpeg转码的MP4文件需要加载完了才能播放的解决办法
- 错误RuntimeError: Invalid DISPLAY variable
热门文章
- (翻译)2016美国数学建模MCM E题(环境)翻译:我们朝向一个干旱的星球?
- Android在网络上分析获取图片(支持bmp格式)
- expdp备份速度慢的问题
- Android Studio ERROR: x86 emulation currently requires hardware acceleration!报错解决傻瓜教程~
- Codeforces 385 D Bear and Floodlight
- 分布式缓存技术PK:选择Redis还是Memcached?
- zabbix从听说到学会
- build-qt.sh(Cross compile in Linux for Windows)
- maven_默认新建项目jdk1.6_默认配置
- DataGrid自定义复选框