SamusevWinApp/EditForm.cs

57 lines
1.3 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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)
{
}
}
}