当前位置:网站首页>C countdown tool
C countdown tool
2022-07-28 09:47:00 【biyusr】
Recently, a friend was playing an online game , There are games 10 Several small leaders , After the death of the little head, every 10 Minutes to refresh . There are many players fighting against monsters , Who was hurt for the first time ,boss Who owns the goods after death , Friends suffer from not being able to count small leaders boss Time to refresh . Always can't win others . I want to help him get a multi-point countdown time software . I feel bored and feasible , Do as you say .
The software interface is provided by :2 Button ( add to 、 Delete )、 One listView, One pictureBox, One timer The clock of .

Dotnet Industrial control
Focus on sharing DotNET Programming experience , Mining programmers' excellent learning resources .
7 Original content
official account

Design when starting listView Column : You can only select the whole line to be designed listView1.FullRowSelect by True, Design timer To count down , In seconds .
private void Form1_Load(object sender, EventArgs e){comboBox1.SelectedIndex = 0;listView1.Columns.Add(" count down / second ",80,HorizontalAlignment.Left);listView1.Columns.Add(" Set the time ");listView1.Columns.Add(" Picture address ", 100, HorizontalAlignment.Left);listView1.FullRowSelect = true;// Only one line can be selectedtimer1.Interval = 1000;timer1.Start();}
2. Add a button , Load pictures and save pictures , Convenient to check next time .
private void button1_Click(object sender, EventArgs e){pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;// The picture is pulled up or down , To adapt to picture Controlstring url; Save the picture addresspictureBox1.Image = GetScreenCapture(out url); // Use the method to load the mapListViewItem listViewItem = new ListViewItem();string timeritem = System.Text.RegularExpressions.Regex.Replace(comboBox1.Text, @"[^0-9]+", ""); // Ask for numberslistViewItem.Text = (int.Parse(timeritem)*60).ToString();listViewItem.SubItems.Add($"{comboBox1.Text}");listViewItem.SubItems.Add(url);listView1.Items.Add(listViewItem);}private Bitmap GetScreenCapture(out string url){Rectangle tScreenRect = new Rectangle(0, 0, Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);Bitmap tSrcBmp = new Bitmap(tScreenRect.Width, tScreenRect.Height); // Used to save the original picture of the screenGraphics gp = Graphics.FromImage(tSrcBmp);gp.CopyFromScreen(0, 0, 0, 0, tScreenRect.Size);gp.DrawImage(tSrcBmp, 0, 0, tScreenRect, GraphicsUnit.Pixel);Random ran = new Random();url = @$"temp\{ran.Next(1, 999)}.jpg";tSrcBmp.Save(url);return tSrcBmp;}
3. Need to update the countdown by seconds , stay timer Update all the countdown in the clock ,
private void timer1_Tick(object sender, EventArgs e){this.listView1.BeginUpdate(); // Data update ,UI Hang up for a while , until EndUpdate Draw control , Can effectively avoid flashing and greatly improve the loading speedforeach (ListViewItem item in listView1.Items){item.SubItems[0].Text = (int.Parse(item.SubItems[0].Text) - 1).ToString();}this.listView1.EndUpdate(); // End of data processing ,UI The interface is drawn once .}/// <summary>/// Double click to display the picture/// </summary>/// <param name="sender"></param>/// <param name="e"></param>private void listView1_MouseDoubleClick(object sender, MouseEventArgs e){pictureBox1.ImageLocation = listView1.SelectedItems[0].SubItems[2].Text;}/// <summary>/// Delete/// </summary>/// <param name="sender"></param>/// <param name="e"></param>private void button2_Click(object sender, EventArgs e){File.Delete(listView1.SelectedItems[0].SubItems[2].Text);listView1.SelectedItems[0].Remove();}
4. design sketch : Friends are very satisfied , Can calculate to small head second refresh . The countdown is 10 Seconds, hurry to the place to refresh and wait for the little leader . Always able to grab the small leader

5. Afterwards, he asked me if I could help him get a script for automatically fighting monsters and grabbing heads , I'm afraid of him

, Tell him directly that he won't .
边栏推荐
- [gossip] the development of programmers needs two abilities most
- Pytorch deep learning practice lesson 9 multi classification problems (handwritten numeral MNIST)
- 《我的Vivado实战—单周期CPU指令分析》
- 树上启发式合并
- ShardingSphere之分库分表概念介绍(二)
- 【日志】日志干什么的?日志工厂是什么?log4j 的配置和使用? log4j.properties 文件配置、log4j jar包坐标
- Salted fish esp32 instance - mqtt lit LED
- 使用Xposed对软件进行破解
- Introduction to SD card (based on spec3.0)
- Go language slice vs array panic runtime error index out of range problem solving
猜你喜欢

Personal blog applet

网络工程——软科中国大学专业排名

pycharm使用conda调用远程服务器

Basic operation of MATLAB

IJCAI 2022 | the latest overview of graph structure learning: research progress and future prospects

SQL server, MySQL master-slave construction, EF core read-write separation code implementation

MQ learning

Method parameter transfer mechanism of C #

业务可视化-让你的流程图'Run'起来(4.实际业务场景测试)

How promise instance solves hell callback
随机推荐
[Guangxi University] information sharing of postgraduate entrance examination and re examination
MySQL中各类型文件详解
《PyTorch深度学习实践》第九课多分类问题(手写数字MNIST)
IJCAI 2022 | the latest overview of graph structure learning: research progress and future prospects
对话MySQL之父:代码一次性完成才是优秀程序员
matlab基本操作
go语言切片Slice和数组Array对比panic runtime error index out of range问题解决
Source code analysis of activityrouter
SD卡介绍(基于SPEC3.0)
Retrofit source code analysis
Analysis of HashSet internal principle
How to learn so many conceptual things in database? Seeking method
How promise instance solves hell callback
Hexadecimal representation of negative numbers
Oracle creates users with query permission only
IJCAI 2022 | 图结构学习最新综述:研究进展与未来展望
C signed and unsigned byte variables
【AUTOSAR-RTE】-3-Runnable及其Task Mapping映射
Which system table is the keyword of SQL Server in?
关于CLR GC调优的一些问题