当前位置: 首页 > news >正文

东莞优化网站关键词优化网站猜你喜欢代码

东莞优化网站关键词优化,网站猜你喜欢代码,电商网站的建设步骤,水印logo在线制作生成器一、了解WPF的框架结构 (第一小节随便看下就可以,简单练习就行) 1、新建WPF项目 xmlns:XML的命名空间 Margin外边距:左上右下 HorizontalAlignment:水平位置 VerticalAlignment:垂直位置 2…

一、了解WPF的框架结构

(第一小节随便看下就可以,简单练习就行)

1、新建WPF项目

 

xmlns:XML的命名空间 

 Margin外边距:左上右下

HorizontalAlignment:水平位置

VerticalAlignment:垂直位置

 2、Border的使用

效果:

3、LoginWindow窗口

在Wpf中不是所有的标签都有Name属性,但是一定有x:Name,x:Name为了保证所有标签的唯一性 

PasswordBox是密码框

winform中窗体的加载事件:Load,WPF中窗体的加载事件是Loaded

代码:

LoginWindow.xaml的代码

<Window x:Class="WpfApp1.LoginWindow"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:local="clr-namespace:WpfApp1"mc:Ignorable="d"Title="LoginWindow" Height="450" Width="800" Loaded="Window_Loaded"><Border BorderBrush="Green" BorderThickness="3" CornerRadius="10"><!--BorderBrush:边框的颜色  BorderThickness:边框的厚度/粗细  CornerRadius:边框四个角的半径--><Grid><TextBlock HorizontalAlignment="Left" Margin="213,150,0,0" TextWrapping="Wrap" Text="账号" VerticalAlignment="Top"/><TextBlock HorizontalAlignment="Left" Margin="213,200,0,0" TextWrapping="Wrap" Text="密码" VerticalAlignment="Top" RenderTransformOrigin="-0.067,-2.57"/><TextBox Name="txtUserCount" HorizontalAlignment="Left" Height="23" Margin="306,149,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="208"/><Button  Name="btnLogin" Content="登录" HorizontalAlignment="Left" Margin="230,268,0,0" VerticalAlignment="Top" Width="75" Click="BtnLogin_Click"/><Button Name="btnClose" Content="关闭" HorizontalAlignment="Left" Margin="351,267,0,0" VerticalAlignment="Top" Width="75"/><PasswordBox x:Name="txtUserPwd" HorizontalAlignment="Left" Margin="306,200,0,0" VerticalAlignment="Top" Width="208" Height="23"/><DataGrid HorizontalAlignment="Left" Height="100" Margin="372,430,0,-115.6" VerticalAlignment="Top" Width="100"/><!--在Wpf中不是所有的标签都有Name属性,但是一定有x:Name,x:Name为了保证所有标签的唯一性--></Grid></Border>
</Window>

 LoginWindow.xaml.cs的代码

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;namespace WpfApp1
{/// <summary>/// LoginWindow.xaml 的交互逻辑/// </summary>public partial class LoginWindow : Window{public LoginWindow(){InitializeComponent();}private void BtnLogin_Click(object sender, RoutedEventArgs e){string userAccount = txtUserCount.Text;string userPwd = txtUserPwd.Password;//this.txtUserPwd.SecurePassword;//加密字符串,保存成内存地址MainWindow mainWindow = new MainWindow();mainWindow.Show();this.Close();}/// <summary>/// 窗体加载事件/// </summary>/// <param name="sender"></param>/// <param name="e"></param>private void Window_Loaded(object sender, RoutedEventArgs e){}}
}

效果图:

4、文本框旋转

选中文本框,鼠标放到文本框的四个角的任意一个边上,然后旋转即可

 默认的文本框有如下属性:

旋转后的文本框:

 5、关闭主窗体,其他窗体不关

MainWindow界面:

 MainWindow.xaml代码:

<Window x:Class="WpfApp1.MainWindow"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:local="clr-namespace:WpfApp1"mc:Ignorable="d"Title="MainWindow" Height="450" Width="800"><Grid><TextBox HorizontalAlignment="Left" Height="23" Margin="311,163,0,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Width="120" RenderTransformOrigin="0.5,0.5"><!--transform:使改变、使转换 render:提供 scale:天平 skew:歪曲 rotate:旋转 translate:翻译、转变、变为--><TextBox.RenderTransform><TransformGroup><ScaleTransform/><SkewTransform/><RotateTransform Angle="25.259"/><TranslateTransform/></TransformGroup></TextBox.RenderTransform></TextBox><Button Content="返回" HorizontalAlignment="Left" Margin="318,288,0,0" VerticalAlignment="Top" Width="116" Height="41" Click="Button_Click"/><Button x:Name="btnClose" Content="关闭" HorizontalAlignment="Left" Margin="562,288,0,0" VerticalAlignment="Top" Width="137" Height="41" Click="BtnClose_Click"/><TextBox HorizontalAlignment="Left" Height="23" Margin="81,158,0,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Width="120" RenderTransformOrigin="0.5,0.5"><TextBox.RenderTransform><TransformGroup><ScaleTransform/><SkewTransform/><RotateTransform Angle="16.461"/><TranslateTransform/></TransformGroup></TextBox.RenderTransform></TextBox></Grid>
</Window>

 MainWindow.xaml.cs代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;namespace WpfApp1
{/// <summary>/// MainWindow.xaml 的交互逻辑/// </summary>public partial class MainWindow : Window{public MainWindow(){InitializeComponent();}//返回按钮private void Button_Click(object sender, RoutedEventArgs e){LoginWindow loginWindow = new LoginWindow();loginWindow.Show();this.Close();}//关闭按钮private void BtnClose_Click(object sender, RoutedEventArgs e){Application.Current.Shutdown();//关闭应用程序,杀死进程}}
}

 

二、WPF常用基础控件结构和应用

三、StockPanel堆栈面板,WrapPanel流布局面板

四、DockPanel停靠面板,Canvas坐标面板

五、复杂的Grid表格容器面板

六、直接_冒泡_隧道路由事件、InkCanvas面板

七、ListView数据控件(带右键菜单)

八、Animation动画制作类,声音合成器(类)

http://www.yayakq.cn/news/150798/

相关文章:

  • 嘉兴网站专业制作一级a做爰精免费网站
  • 网站集约化建设优势大连网络推广机构
  • ios网站开发教程ppt模板简洁大方
  • 品牌官方网站wordpress已卸载插件数据
  • 快速排名网站有做教育行业的招聘网站吗
  • 做排行的网站做网站找个人还是找公司
  • 做冻品海鲜比较大的网站有哪些织梦做的网站怎么会被黑
  • 做外贸网站需要多少钱做翻译 英文网站
  • 建设银行网站登陆不了58同城本地版下载
  • 广告网站定制wordpress 缩放窗 修改
  • 网站域名备案证书下载夏天做那个网站能致富
  • 建设网站的分析报告关注love石家庄公众号微信
  • 投资理财网站开发网站建立费用多少钱
  • 长沙做网站湖南微联讯点不错微信小程序可视化编辑器免费
  • 太原网站建设需求多嘛网站数据统计工具
  • 沈阳 教育 公司 网站建设纸箱 技术支持 东莞网站建设
  • 企业网站建设属于什么科目开发小程序的成本
  • 招聘网站建设规划书网页设计作品下载
  • 网站用的服务器多少钱辽ICP备 网站建设 中企动力
  • 网站分哪几种精品资料网 资料库
  • 九江网站网站建设建设个电影网站多少钱
  • 做app和做网站那个难线上平台推广是做什么的
  • 网站建设公司如何约客户wordpress字体在哪个文件夹
  • 深圳坪山住房和建设局网站制作灯笼教程
  • 网站权重2的网站腾讯云主机网站建设教程
  • 可以直接用php做网站吗广西壮族自治区建设厅官方网站
  • 项目网站有哪些asp网站开发的开发环境
  • wordpress页脚郑州seo关键词
  • 营销型网站公司名称电商网站创建的几个阶段
  • wordpress把站学网站开发月薪多少