using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ChangeNumberLength
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int number = textBox1.Text.Length;
for (;number < 10;number++)
{
textBox1.Text = "0" + textBox1.Text;
}
MessageBox.Show("Change number is" + textBox1.Text,"Tips",MessageBoxButtons.YesNo);
}
}
}
定长数字,不足位数前边补0
最新推荐文章于 2024-08-27 12:25:17 发布