57 lines
1.3 KiB
C#
57 lines
1.3 KiB
C#
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 samusev_42
|
||
{
|
||
public partial class EditForm : Form
|
||
{
|
||
/// валидация
|
||
public EditForm()
|
||
{
|
||
InitializeComponent();
|
||
|
||
|
||
this.textBox5.Validating += textBoxPrice_Validating;
|
||
}
|
||
|
||
private void textBoxPrice_Validating(object sender, CancelEventArgs e)
|
||
{
|
||
|
||
if (!string.IsNullOrWhiteSpace(textBox5.Text) && !decimal.TryParse(textBox5.Text, out _))
|
||
{
|
||
MessageBox.Show("В поле 'Цена' можно вводить только числа!", "Ошибка формата",
|
||
MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||
|
||
textBox5.SelectAll();
|
||
e.Cancel = true;
|
||
}
|
||
}
|
||
|
||
private void SaveEditButton_Click(object sender, EventArgs e)
|
||
{
|
||
|
||
}
|
||
|
||
private void label10_Click(object sender, EventArgs e)
|
||
{
|
||
|
||
}
|
||
|
||
private void EditForm_Load(object sender, EventArgs e)
|
||
{
|
||
|
||
}
|
||
|
||
private void label7_Click(object sender, EventArgs e)
|
||
{
|
||
|
||
}
|
||
}
|
||
} |