C# WinForm基础

2023-05-16

1. WinForm基础

    

Form1.cs

  1. using System;   
  2. using System.Collections.Generic;   
  3. using System.ComponentModel;   
  4. using System.Data;   
  5. using System.Drawing;   
  6. using System.Linq;   
  7. using System.Text;   
  8. using System.Windows.Forms;   
  9.   
  10. namespace WinsForm基础   
  11. {   
  12.     public partial class Form1 : Form   
  13.     {   
  14.         public Form1()   
  15.         {   
  16.             InitializeComponent();   
  17.         }   
  18.   
  19.         private void button1_Click(object sender, EventArgs e)   
  20.         {   
  21.                
  22.             string name = textBox1.Text;//得到编辑框中的文字   
  23.             //this.Text = name + "你好";//设置这个窗体的文字   
  24.             this.Text = string.Format("{0}你好", name);   
  25.                
  26.                
  27.             //当点击文本框时,隐藏文本框    
  28.             textBox1.Hide();   
  29.   
  30.         }   
  31.   
  32.         private void button2_Click(object sender, EventArgs e)   
  33.         {   
  34.             string str2 = textBox2.Text;   
  35.             string str3 = textBox3.Text;   
  36.             int i1, i2;   
  37.             if (!int.TryParse(str2, out i1))   
  38.             //out传参前,可以不对参数初始化,out的函数会清空变量,即使变量已经赋值也不行;   
  39.             //ref传参前,必须对参数初始化   
  40.             {   
  41.                 MessageBox.Show("第一个数不是合法的整数");   
  42.                 return;//不要忘了return   
  43.             }   
  44.             if (!int.TryParse(str3, out i2))   
  45.             {   
  46.                 MessageBox.Show("第二个数不是合法的整数");   
  47.                 return;   
  48.             }   
  49.             int i3 = i1 + i2;   
  50.             textBox4.Text = Convert.ToString(i3);   
  51.         }   
  52.     }   
  53. }

2. email分析

Form1.cs

  1. using System;   
  2. using System.Collections.Generic;   
  3. using System.ComponentModel;   
  4. using System.Data;   
  5. using System.Drawing;   
  6. using System.Linq;   
  7. using System.Text;   
  8. using System.Windows.Forms;   
  9.   
  10. namespace email分析   
  11. {   
  12.     public partial class Form1 : Form   
  13.     {   
  14.         public Form1()   
  15.         {   
  16.             InitializeComponent();   
  17.         }   
  18.   
  19.         private void button1_Click(object sender, EventArgs e)   
  20.         {   
  21.             string email = textBox1.Text;   
  22.             string[] strs = email.Split('@');   
  23.             if (strs.Length != 2)   
  24.             {   
  25.                 MessageBox.Show("非法的email地址!");   
  26.                 return;//不要忘了return   
  27.             }   
  28.             textBox2.Text = strs[0];   
  29.             textBox3.Text = strs[1];   
  30.         }   
  31.   
  32.         private void Form1_Load(object sender, EventArgs e)   
  33.         {   
  34.   
  35.         }   
  36.     }   
  37. }   

 

3. 滚动1

  1. using System;   
  2. using System.Collections.Generic;   
  3. using System.ComponentModel;   
  4. using System.Data;   
  5. using System.Drawing;   
  6. using System.Linq;   
  7. using System.Text;   
  8. using System.Windows.Forms;   
  9.   
  10. namespace 滚动1   
  11. {   
  12.     public partial class Form1 : Form   
  13.     {   
  14.         public Form1()   
  15.         {   
  16.             InitializeComponent();   
  17.         }   
  18.   
  19.         private void button1_Click(object sender, EventArgs e)   
  20.         {   
  21.             string str = textBox1.Text;   
  22.             char first = str[0];   
  23.             string 剩下 = str.Substring(1);   
  24.             textBox1.Text = 剩下 + first;   
  25.         }   
  26.   
  27.         private void button2_Click(object sender, EventArgs e)   
  28.         {   
  29.             string str = textBox1.Text;   
  30.             char last = str[4];   
  31.             string 剩下 = str.Substring(0,4);   
  32.             textBox1.Text = last+剩下;   
  33.         }   
  34.   
  35.         private void Form1_Load(object sender, EventArgs e)   
  36.         {   
  37.   
  38.         }   
  39.     }   
  40. }

4. 累加

  1. using System;   
  2. using System.Collections.Generic;   
  3. using System.ComponentModel;   
  4. using System.Data;   
  5. using System.Drawing;   
  6. using System.Linq;   
  7. using System.Text;   
  8. using System.Windows.Forms;   
  9.   
  10. namespace 累加   
  11. {   
  12.     public partial class Form1 : Form   
  13.     {   
  14.         public Form1()   
  15.         {   
  16.             InitializeComponent();   
  17.         }   
  18.   
  19.         private void Form1_Load(object sender, EventArgs e)   
  20.         {   
  21.   
  22.         }   
  23.   
  24.         private void button1_Click(object sender, EventArgs e)   
  25.         {   
  26.             string s1 = textBox1.Text;   
  27.             string s2 = textBox2.Text;   
  28.             int i1, i2;   
  29.             if (int.TryParse(s1, out i1) == false)   
  30.             {   
  31.                 MessageBox.Show("数字1格式错误!");   
  32.                 return;   
  33.             }   
  34.             if (int.TryParse(s2, out i2) == false)   
  35.             {   
  36.                 MessageBox.Show("数字2格式错误!");   
  37.                 return;   
  38.             }   
  39.             if (i1 >= i2)   
  40.             {   
  41.                 MessageBox.Show("第二个数要大于第一个数!");   
  42.                 return;   
  43.             }   
  44.             int sum = 0;   
  45.             for (int i = i1; i <= i2; i++)   
  46.             {   
  47.                 sum = sum + i;   
  48.             }   
  49.             textBox3.Text = Convert.ToString(sum);   
  50.         }   
  51.     }   
  52. }   

5. 登录界面1

  1. using System;   
  2. using System.Collections.Generic;   
  3. using System.ComponentModel;   
  4. using System.Data;   
  5. using System.Drawing;   
  6. using System.Linq;   
  7. using System.Text;   
  8. using System.Windows.Forms;   
  9.   
  10. namespace 登录界面1   
  11. {   
  12.     public partial class Form1 : Form   
  13.     {   
  14.         private int ErrorTimes = 0;//错误的次数   
  15.         public Form1()   
  16.         {   
  17.             InitializeComponent();   
  18.         }   
  19.   
  20.         private void button1_Click(object sender, EventArgs e)   
  21.         {   
  22.             //方法一   
  23.             textBox4.AppendText(DateTime.Now.ToString()+"/n");   
  24.             //方法二   
  25.             //textBox4.Text = textBox4.Text+ DateTime.Now.ToString() + "/n" ;   
  26.         }   
  27.   
  28.         private void login_Click(object sender, EventArgs e)   
  29.         {   
  30.             string username = txtUserName.Text.Trim();//Trim忽略大小写   
  31.             string password = txtPassWord.Text;   
  32.             if (username.Equals("admin", StringComparison.   
  33.                 OrdinalIgnoreCase) && password == "888888")   
  34.             {   
  35.                 MessageBox.Show("登录成功!");   
  36.             }   
  37.             else  
  38.             {   
  39.                 ErrorTimes++;//错误次数加1   
  40.                 if (ErrorTimes > 3)   
  41.                 {   
  42.                     MessageBox.Show("错误次数过多,程序即将退出!");   
  43.                     Application.Exit();   
  44.                 }   
  45.                 MessageBox.Show("登录失败!");   
  46.             }   
  47.         }   
  48.   
  49.         private void btnModify_Click(object sender, EventArgs e)   
  50.         {   
  51.             string oldpassword = txtUserName.Text;//取旧密码   
  52.             string newpassword = txtPassWord.Text;   
  53.             string newpassword2 = newPassWord2.Text;   
  54.             if (oldpassword != "888888")   
  55.             {   
  56.                 MessageBox.Show("旧密码错误!");   
  57.                 return;   
  58.             }   
  59.             if (newpassword != newpassword2)   
  60.             {   
  61.                 MessageBox.Show("两次输入的新密码不一致!");   
  62.                 return;   
  63.             }   
  64.             if (newpassword == oldpassword)   
  65.             {   
  66.                 MessageBox.Show("旧密码和新密码不能一样!");   
  67.                 return;   
  68.             }   
  69.             MessageBox.Show("修改成功!");   
  70.   
  71.         }   
  72.     }   
  73. }   

6. 图片显示1

  1. using System;   
  2. using System.Collections.Generic;   
  3. using System.ComponentModel;   
  4. using System.Data;   
  5. using System.Drawing;   
  6. using System.Linq;   
  7. using System.Text;   
  8. using System.Windows.Forms;   
  9.   
  10. namespace 图片显示1   
  11. {   
  12.     public partial class Form1 : Form   
  13.     {   
  14.         public Form1()   
  15.         {   
  16.             InitializeComponent();   
  17.         }   
  18.   
  19.         private void button1_Click(object sender, EventArgs e)   
  20.         {   
  21.             string 身份证号 = textBox1.Text;   
  22.             //叫验是否是合法的身份证号   
  23.             pictureBox1.Visible = true;   
  24.             string strYear = 身份证号.Substring(6,4);   
  25.             int year = Convert.ToInt32(strYear);   
  26.             if ((DateTime.Now.Year - year >= 18)==true)   
  27.             {   
  28.                 pictureBox1.Visible = true;   
  29.                 return;   
  30.             }   
  31.             else  
  32.             {   
  33.                 MessageBox.Show("你的年龄小于18,无法查看!");   
  34.                 //pictureBox1.Visible = false;   
  35.                 return;   
  36.             }   
  37.         }   
  38.     }   
  39. }  

7. 统计成绩

  1. using System;   
  2. using System.Collections.Generic;   
  3. using System.ComponentModel;   
  4. using System.Data;   
  5. using System.Drawing;   
  6. using System.Linq;   
  7. using System.Text;   
  8. using System.Windows.Forms;   
  9.   
  10. namespace 统计成绩   
  11. {   
  12.     public partial class Form1 : Form   
  13.     {   
  14.         public Form1()   
  15.         {   
  16.             InitializeComponent();   
  17.         }   
  18.   
  19.         private void btnResult_Click(object sender, EventArgs e)   
  20.         {   
  21.             //string s = txt成绩.Text;   
  22.             //方法1:按照/r/n进行split   
  23.             string[] lines=txt成绩.Lines;//方法2   
  24.             string maxName="";   
  25.             int maxScore = -1;   
  26.             foreach (string line in lines)   
  27.             {   
  28.                 string[] strs = line.Split('=');   
  29.                 string name=strs[0];   
  30.                 string strScore=strs[1];   
  31.                 int score = Convert.ToInt32(strScore);   
  32.                 if (score > maxScore)   
  33.                 {   
  34.                     maxName = name;   
  35.                     maxScore = score;   
  36.                 }   
  37.             }   
  38.             MessageBox.Show(string.Format("{0}是第一名,成绩是{1}",   
  39.                 maxName,maxScore));   
  40.         }   
  41.     }   
  42. }   

8. 下拉列表

  1. using System;   
  2. using System.Collections.Generic;   
  3. using System.ComponentModel;   
  4. using System.Data;   
  5. using System.Drawing;   
  6. using System.Linq;   
  7. using System.Text;   
  8. using System.Windows.Forms;   
  9.   
  10. namespace 下拉列表   
  11. {   
  12.     public partial class Form1 : Form   
  13.     {   
  14.         public Form1()   
  15.         {   
  16.             InitializeComponent();   
  17.         }   
  18.         private void comboBox1_Click(object sender, EventArgs e)   
  19.         {   
  20.             MessageBox.Show(Convert.ToString   
  21.                 (comboBox1.SelectedIndex));//第几项   
  22.             MessageBox.Show(Convert.ToString   
  23.                 (comboBox1.SelectedValue));   
  24.             MessageBox.Show(Convert.ToString   
  25.                 (comboBox1.SelectedText));//数据库中将用到   
  26.             MessageBox.Show(Convert.ToString   
  27.                 (comboBox1.SelectedItem));//选中的项的内容   
  28.         }   
  29.   
  30.         private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)   
  31.         {   
  32.             MessageBox.Show(Convert.ToString(comboBox1.SelectedItem));   
  33.         }   
  34.   
  35.         private void btnResult_Click(object sender, EventArgs e)   
  36.         {   
  37.             string str1 = txtNumber1.Text;   
  38.             string str2 = txtNumber2.Text;   
  39.             int i1 = Convert.ToInt32(str1);   
  40.             int i2 = Convert.ToInt32(str2);   
  41.             int result;   
  42.   
  43.             switch (cb操作符.SelectedIndex)   
  44.             {   
  45.                 case 0://+   
  46.                     result = i1 + i2;   
  47.                     break;   
  48.                 case 1://-   
  49.                     result = i1 - i2;   
  50.                     break;   
  51.                 case 2://*   
  52.                     result = i1 * i2;   
  53.                     break;   
  54.                 case 3:// /   
  55.                     if (i2 == 0)   
  56.                     {   
  57.                         MessageBox.Show("0不能为除数!");   
  58.                         return;   
  59.                     }   
  60.                     result = i1 / i2;   
  61.                     break;   
  62.                 default:   
  63.                     throw new Exception("未知的运算符");   
  64.             }   
  65.             txtResult.Text = Convert.ToString(result);   
  66.         }   
  67.   
  68.   
  69.     }   
  70. }   

9. 省市选择

  1. using System;   
  2. using System.Collections.Generic;   
  3. using System.ComponentModel;   
  4. using System.Data;   
  5. using System.Drawing;   
  6. using System.Linq;   
  7. using System.Text;   
  8. using System.Windows.Forms;   
  9.   
  10. namespace 省市选择   
  11. {   
  12.     public partial class Form1 : Form   
  13.     {   
  14.         public Form1()   
  15.         {   
  16.             InitializeComponent();   
  17.         }   
  18.   
  19.         private void cb省_SelectedIndexChanged(object sender, EventArgs e)   
  20.         {   
  21.             cb市.Items.Clear();//清空旧数据   
  22.             string 省 = Convert.ToString(cb省.SelectedItem);   
  23.             if(省=="山东")   
  24.             {   
  25.                 cb市.Items.Add("潍坊");   
  26.                 cb市.Items.Add("临沂");   
  27.                 cb市.Items.Add("青岛");   
  28.             }   
  29.             if (省 == "河南")   
  30.             {   
  31.                 cb市.Items.Add("郑州");   
  32.                 cb市.Items.Add("三门峡");   
  33.                 cb市.Items.Add("洛阳");   
  34.             }   
  35.             if (省 == "湖南")   
  36.             {   
  37.                 cb市.Items.Add("长沙");   
  38.                 cb市.Items.Add("衡阳");   
  39.                 cb市.Items.Add("邵阳");   
  40.             }   
  41.         }   
  42.     }   
  43. }   
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

C# WinForm基础 的相关文章

  • 02--C#Winform--控件大小随窗口大小改变等比例变化

    最近在做Winform相关的项目 xff0c 这就会涉及到如何将窗口里的控件大小随窗口的调整而改变大小 xff0c 一开始想要直接调整窗口以及控件的属性来达到效果 xff0c 比如 xff0c Anchor和Dock属性 xff0c 但是没
  • C#winform使用进度条

    在用c 做WinFrom开发的过程中 我们经常需要用到进度条 xff08 ProgressBar xff09 用于显示进度信息 这时候我们可能就需要用到多线程 xff0c 如果不采用多线程控制进度条 xff0c 窗口很容易假死 xff08
  • winform中UI设计分辨率问题

    1 UI设计可以自适应或固定分辨率 xff0c 自适应需要手动写调整控件尺寸位置代码 xff1b 固定分辨率需要固定尺寸的UI资源图片 xff08 如背景图片 xff09 和固定的终端分辨率 xff08 如pc端不一致需调整分辨率为初始设计
  • winform-日记

    1 Form的属性TopLevel设置为false xff0c 就相当于usercontrol的功能了 xff0c 可以被包含在容器中 xff0c 只不过需要动态在代码中加载 xff0c usercontrol则可拖拽
  • winform中进行动态布局

    在某些网页中 xff0c 对有些按钮进行选择后 xff0c 网页中的布局会增加或者减少 xff0c 无论增加还是减少 xff0c 都会按照顺序进行排序 这个效果在winform中也是可以的 1 建立一个winform项目 2 拖动控件后 x
  • VS2019使用C++创建winform界面

    用C 43 43 实现winform界面 算是对上一篇文章的补充吧 xff0c 实际上不需要那么繁琐也可以做到 事先准备 打开VS xff0c 新建一个CLR项目 如果在选项中没有发现CLR项目 xff1a 1 找到Visual Studi
  • C#WinForm

    WinForm 是 Windows Form 的简称 xff0c 是基于 NET Framework 平台的客户端 xff08 PC软件 xff09 开发技术使用 C 编程 C WinForm 编程需要创建Windows窗体应用程序项目 W
  • C# winform事件执行顺序

    转载地址 https www cnblogs com luoyaoquan archive 2011 06 30 2094255 html 目录 Paint事件Load事件Refresh方法 进入控件时 xff1a 先激发OnEnter后激
  • Winform datagridview中显示下拉框示例

    方式一 xff1a 如下图所示 xff0c 该方式也是较为简单的一种 你只需要添加一列类型为DataGridViewComboBoxColumn的列 xff0c 然后添加数据源即可 但是我们看到这种方式的下拉列表看起来并不是十分的美观 xf
  • 打造属于自己的正则表达式

    概述 首先需要说明的一点 无论是Winform 还是Webform 都有很成熟的日历控件 无论从易用性还是可扩展性上看 日期的选择和校验还是用日历控件来实现比较好 前几天在CSDN多个版块看到需要日期正则的帖子 所以整理了这篇文章 和大家一
  • 未能加载文件或程序集 Microsoft.ReportViewer.Common, Version=11.0.0.0

    WinForm客户端软件开发时 使用rdlc做报表 并且使用ReportViewer呈现报表时 开发者的机器运行正常 但是部署到第三方机器上运行时报错 大致有以下几种错误 1 未能加载文件或程序集 Microsoft ReportViewe
  • Winform实现ComboBox模糊查询

    1 新增项目 using System using System Collections Generic using System ComponentModel using System Data using System Drawing
  • winform 中 Devexpress Charts动态添加数据

    参考 Devexpress Charts动态添加数据 https www cnblogs com zhangruisoldier p 4226950 html DevExpress 图表控件 ChartControl 动态绑定数据 http
  • C#客户端Json转DataTable

    之前我们有讨论过c 是如何处理json的 在我的客户端中 需要接收服务端的数据 并且用列表展示出来 列表控件我采用的是winfrom自带的DataGridView 从服务端得到的响应是一串json字符串 为了提高效率和简洁代码 我不想采用解
  • C#winform——添加不同语言环境下的resx,使得显示文本能随语言环境变化

    添加不同语言环境下的resx 添加不同语言resx文件的两种情形 窗体控件 非窗体控件 为窗体控件添加不同语言resx文件 为非窗体控件添加不同语言resx文件 添加不同语言resx文件的两种情形 窗体控件 1 如下所示 需要在不同语言环境
  • DataGridView控件用法(二):为每行记录最后加“编辑”-“删除”按钮列

    1 在DataGridView控件用法 一 中已经显示出列表数据 这时我们需要对每行数据记录进行编辑 需要添加 编辑 删除 查看 这样的超链接 代码如下 view source print 1 为每行数据增加编辑列 2 设定列不能自动作成
  • Winform 登录页面创建和设置

    Winform 登录页面设置 自带的Form1进行改造 更换名字为FrmLogin 简单先不放置容器 直接先托两个TextBox 再放两个lable分别改好名字 设置密码框的textbox的PasswordChar设置为 再拖两个普通的bu
  • 「干货分享」DevExpress常用控件——RichEditControl使用指南

    做WinForms的一般都知道 传统 NET界面有一个RichTextBox控件 这个是一个富文本控件 可以存储图片文字等内容 它有自己的文件格式RTF 在DevExpress控件组里面也有一个同等的控件 他的名字是RichEditCont
  • WinForm应用实战开发指南 - 如何开发工作流模块的审批会签操作(二)

    前面文章中 点击这里回顾 gt gt 介绍了请假申请单和报销申请单两个不同的业务表单的流程处理 一个是单表信息 一个包含明细的主从表信息 后者包含了条件流程的处理 在流程审批中 一般还有一种流程处理就是会签的操作 会签处理是几个审批步骤中审
  • DevExpress WinForms导航控件 - 交付更时尚、体验更好的业务应用(一)

    DevExpress WinForms的Side Navigation 侧边导航 和Nav Panel 导航面板 可以帮助客户交付完全可模仿UI体验的业务解决方案 这些体验在当今流行的应用程序中都可找到 DevExpress WinForm

随机推荐

  • Visio、Matlab高清图片插入word文档的几种方法。

    2023 3 30 直接参考这两个就行了 xff0c 不用花里胡哨的 MATLAB 1 重要的第一步 xff0c 另存为png图片 xff1b 2 导出之前先设置分辨率 xff0c 很多期刊要求600dpi 这一步很关键 Visio 1 重
  • CTF Crypto---RSA NC不互素

    题目 span class token keyword from span Crypto span class token punctuation span Util span class token punctuation span nu
  • 看一看Ubuntu的目录结构

    先了解一下Ubuntu的目录结构 xff0c 对于后面学习Ubuntu软件安装和使用都有帮助 一 Linux没有盘符这个概念 Windows存在多个驱动器盘符 xff0c 每个盘符形成多个树形并列的情形 xff0c Linux没有盘符这个概
  • 【C语言】——结构体进阶:结构体的内存对齐(超详细)

    前言 xff1a 上一篇已经讲了结构体的基本用法 相信各位小伙伴以经学会怎么使用 但是还有一个问题没有弄明白 结构体到底多大 xff0c 占内存空间多不多 xff0c 以经系统到底怎么访问结构体内的数据的 接下来 xff0c 详细分析一下结
  • [OpenCV实战]15 基于深度学习的目标跟踪算法GOTURN

    目录 1 什么是对象跟踪和GOTURN 2 在OpenCV中使用GOTURN 3 GOTURN优缺点 4 参考 在这篇文章中 xff0c 我们将学习一种基于深度学习的目标跟踪算法GOTURN GOTURN在Caffe中搭建 xff0c 现在
  • **在Linux的shell脚本里激活conda 虚拟环境**

    在Linux的shell脚本里激活conda 虚拟环境 之前突发其想 xff0c 既然在命令行可以通过conda activate tf激活tf的虚拟环境 xff0c 那么能不能写个脚本实现呢 xff1f 费了好大劲 xff0c 发现并不行
  • Hierarchical Russian Roulette for Vertex Connections论文研读

    第二篇论文研读文章了 xff0c 虽然依旧很菜 xff0c 但这一篇开始就相对轻松一点了 文档种有些问题 xff0c 其中所有 实时 应该替换为 高效 Hierarchical Russian Roulette for Vertex Con
  • ARM通用中断控制器GIC之中断控制

    在阅读本章之前 xff0c 可以参考笔者之前关于GIC的一些描述 xff1a ARM通用中断控制器GIC generic Interrupt Controller 简介 ARM架构Generic Interrupt Controller G
  • 最小生成树之Kruskal算法

    给定一个无向图 xff0c 如果它任意两个顶点都联通并且是一棵树 xff0c 那么我们就称之为生成树 Spanning Tree 如果是带权值的无向图 xff0c 那么权值之和最小的生成树 xff0c 我们就称之为最小生成树 MST Min
  • xcode11解决:xcode multiple commands produce .../xxx/Assets.car

    最近在xcode 11上使用pod碰到一个问题 xff0c Assets car被生成多次 问题如下 xff1a Multiple commands produce 39 Users luowei Library Developer Xco
  • 算法 —— 冒泡排序

    冒泡排序 冒泡排序是比较两个相邻元素 xff0c 如果它们不符合预期的顺序就交换的一个排序过程 冒泡排序就像水中气泡上升到水面的运动一样 xff0c 数组的每个元素在每次迭代中都把当前迭中最大 或最小 的元素移动到最后 xff0c 因此被称
  • UICollectionView viewForSupplementaryElementOfKind 不调用

    发现UICollectionView 的 方法不调用 func collectionView collectionView UICollectionView viewForSupplementaryElementOfKind kind St
  • UICollectionViewCell 自动大小的两种常用方式

    方法一 xff1a 自动计算 override func viewDidLoad super viewDidLoad if let flowLayout 61 collectionView collectionViewLayout as U
  • UITableViewCell 图片自适应

    常见的一种方法是异步Completed时 xff0c 根据图片大小计算cell的高度并缓存到字典里后 xff0c 刷新tableView或indexPath 但这里介绍另一种更好的方式是使用约束处理 xff0c 对imageView的上下左
  • Swift编译死锁问题

    最近在Swift OC混编项目里遇到个奇怪的问题 xff0c 这样一行代码尽然引发了Swift编译过程死锁 xxSwiftModel salary 61 xxOCModel salary doubleValue 如果哪位大神知道根因 xff
  • 多线程及聊天室程序

    1 一个多线程程序 新建一个 win32 console application 取名 xff1a MultiThread 选空的工程 xff0c 并建立一个名为 MultiThread 的源文件编辑 xff1a include inclu
  • SQL Server 2008语句大全完整版

    61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 设置内存选项 61 61 61 61 61 61 61 61 61 61 61 61 61 61
  • Swift从相册选择图片,图文混排并且可以保存、上传数据

    博主最近突发奇想想做一个自己的日记本App xff0c 在过程中遇到了一些坑 xff0c 摸索了很久才做出一个简单的日记本功能 先来看看一下效果吧 xff1a 先来说说这次用到的一些东西吧 xff1a 1 UIImagePickerCont
  • 2022年ABC模块样题十套分享

    2022年ABC模块样题十套分享 样题分享传送门
  • C# WinForm基础

    1 WinForm基础 Form1 cs using System using System Collections Generic using System ComponentModel using System Data using S