博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
【windows phone】控件1
阅读量:6854 次
发布时间:2019-06-26

本文共 3592 字,大约阅读时间需要 11 分钟。

1     
2         
3
4
5
6 7
8
9
10
11
12 13
14
15
16
17
18
19
20
21
22
23
24
25 26
27
28
29
30
31 32
35 36
39 40
43 44
47 48
51 52
57
62
67 68
72
73
74
75
76
77
78 79 80
85 86
87

---界面代码

 

1 namespace SecondProject  2 {
3 public partial class MainPage : PhoneApplicationPage 4 {
5 // Constructor 6 public MainPage() 7 {
8 InitializeComponent(); 9 } 10 11 private void myButton_Click(object sender, RoutedEventArgs e) 12 {
13 Agent at = new Agent(); 14 at.AgentName = myTextBox.Text; 15 if (myCheckBox.IsChecked==true) 16 {
17 at.IsUndercover=true; 18 } 19 else 20 {
21 at.IsUndercover=false; 22 } 23 //bool bl=at.IsUndercover; 24 //bool? bl=myCheckBox.IsChecked; 25 26 if (myRadioButton1.IsChecked == true) 27 {
28 at.Agency = myRadioButton1.Content.ToString(); 29 } 30 else if (myRadioButton2.IsChecked == true) 31 {
32 at.Agency = myRadioButton2.Content.ToString(); 33 } 34 else 35 {
36 at.Agency = myRadioButton3.Content.ToString(); 37 } 38 39 ListBoxItem lbi = (ListBoxItem)myListBox.SelectedItem; //获取ListBox中所选中的数据 40 at.Proficiency = (string)lbi.Content; 41 42 at.RecordCreatedDateTime = DateTime.Now; 43 44 at.Save(); 45 46 myTextBox.Text = ""; 47 48 myCheckBox.IsChecked = false; 49 50 myRadioButton1.IsChecked = false; 51 myRadioButton2.IsChecked = false; 52 myRadioButton3.IsChecked = false; 53 54 myListBox.SelectedItem = null; 55 56 } 57 } 58 }

---后台代码

1 namespace SecondProject  2 {
3 public class Agent 4 {
5 public string AgentName { get; set; } 6 public string Agency { get; set; } 7 public bool? IsUndercover { get; set; } 8 public string Proficiency { get; set; } 9 public DateTime RecordCreatedDateTime { get; set; } 10 11 12 public void Save() 13 {
14 this.AgentName = ""; 15 this.Agency = ""; 16 this.IsUndercover = false; 17 this.Proficiency = ""; 18 this.RecordCreatedDateTime = DateTime.Now; 19 } 20 } 21 22 23 }

Agent.cs代码

 

 

实现界面效果:

功能:点击“OK”按钮可以实现说有数据清空!

转载地址:http://ssyyl.baihongyu.com/

你可能感兴趣的文章
改进了一下这个游戏的输出及思路,是不是好玩多了??:)
查看>>
Hibernate从入门到放弃(一)----初识ORM
查看>>
OpenSSL 与 SSL 数字证书概念贴
查看>>
云时代下的开源之路 专访阿里云数据库团队
查看>>
Android的sdk、api及工程目录说明
查看>>
RHEL64 缺少ISO 9660图像 安装程序试图挂载映像#1,在硬盘上无法找到该映像
查看>>
源码安装apache
查看>>
CentOS7安装MySQL5.6.27数据库
查看>>
Data Guard Broker系列之五:数据库角色转换
查看>>
第三章_JSP
查看>>
【原创】modb 功能设计之“支持部分MySQL客户端协议”-3
查看>>
Spring中你不知道的注入方式
查看>>
导航点击选中效果重构
查看>>
手机端产生本地图形验证码
查看>>
C++设计模式之1-工厂模式
查看>>
Android自定义View 画弧形,文字,并增加动画效果
查看>>
设计模式 总揽 通过这篇随笔可以访问所需要了解的设计模式
查看>>
Java HotSpot VM中的JIT编译
查看>>
敏捷软件测试--初见
查看>>
NSLayoutConstraint
查看>>