当前位置:网站首页>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 .
边栏推荐
- 业务可视化-让你的流程图'Run'起来(4.实际业务场景测试)
- ARouter源码解析(一)
- Retrofit source code analysis
- Arouter source code analysis (I)
- [summary of leetcode weekly competition] the 83rd fortnight competition of leetcode (7.23)
- 数据库高级学习笔记--存储结构
- Standing on the shoulders of big men, you can see further
- SD卡介绍(基于SPEC3.0)
- 译文推荐 | 调试 BookKeeper 协议 - 无界 Ledger
- Talk to the father of MySQL: code completion at one time is a good programmer
猜你喜欢

使用Xposed对软件进行破解

3分钟告诉你如何成为一名黑客|零基础到黑客入门指南,你只需要掌握这五点能力

Opencv installation configuration test

Express builds a simple local background (1)

OSS直连上传-Rails服务实践

My vivado practice - single cycle CPU instruction analysis

Translation recommendation | debugging bookkeeper protocol - unbounded ledger

MQ learning

NET 3行代码实现文字转语音功能

译文推荐 | 调试 BookKeeper 协议 - 无界 Ledger
随机推荐
Window源码解析(二):Window的添加机制
[summary of leetcode weekly competition] the 83rd fortnight competition of leetcode (7.23)
ShardingSphere简介(一)
WPF布局之控件随着窗口等比放大缩小,适应多分辨率满屏填充应用
JDBC connection database
Analysis of the internal principle of LinkedList
数据库那么多概念性的东西怎么学?求方法
这款微信插件太好用了
Conditions and procedures of stock index futures account opening
Heuristic merging on tree
Common tool functions are constantly updated
Word segmentation results of ES query index fields
Which system table is the keyword of SQL Server in?
Buckle 376 swing sequence greedy
[Guangxi University] information sharing of postgraduate entrance examination and re examination
数据库高级技术学习笔记1--Oracle部署和PL/SQL综述
就这么一个简单的校验,80%的程序员却做不到,更不理解!
ECCV 2022 | 无需微调即可推广!基于配准的少样本异常检测框架
[log] what does a log do? What is a log factory? Configuration and use of log4j? log4j. Properties file configuration, log4j jar package coordinates
业务可视化-让你的流程图'Run'起来(4.实际业务场景测试)