Desktop application-dial function

Please use the desktop application development knowledge you have learned to complete a small software similar to the IOS dial-up function. The functional requirements are as follows:

Insert picture description here
1. The software contains a dialing main window, set the window size: 470 * 760.
2. Set the dial form as: borderless form.
3. Set the initial display position of the dialing window as: the center of the screen.
4. Set the dial window to always be displayed on top of other windows.
5. Set the background color of the dial window. The font and color of each Label are as shown in the figure above. (Special note: If there is no Microsoft Yahei Light font on the test computer, you can use other fonts to replace it)
6. Use the Timer control to write code to realize the call is being called over time, displaying "Calling", "Calling.", "Calling...", "Calling..." The dynamic effect of making a call is created by changing the ellipsis.
7. Set the Cursor of the hang-up control to Hand.
8. When the user clicks to hang up, close the main window and exit the program.

Source code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace dialup
{
    
    
    public partial class Form1 : Form
    {
    
    
        public Form1()
        {
    
    
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
    
    
            this.BackColor = Color.FromArgb(68,57,63);
            label6.ForeColor = Color.FromArgb(112,112,112);
        }

        private void pictureBox4_Click(object sender, EventArgs e)
        {
    
    
            this.Close();
        }
        
        public static int num = -1;
        private void timer1_Tick(object sender, EventArgs e)
        {
    
    
            if(num<3)
            {
    
    
                num++;
            }
            string[] str = new string[] {
    
     "正在呼叫", "正在呼叫.", "正在呼叫..", "正在呼叫..." };
            label2.Text = str[num];
            if (num==3)
            {
    
    
                num = -1;
            }
        }

        private void timer2_Tick(object sender, EventArgs e)
        {
    
    
            this.TopMost = false;
            this.BringToFront();
            this.TopMost = true;
        }
    }
}

Operation result: The

blogger is a little white, and the quality may not be good when he publishes an article for the first time. I hope that you can understand

Guess you like

Origin blog.csdn.net/dwlhh/article/details/114437779
Recommended