This repository has been archived on 2023-01-27. You can view files and clone it, but cannot push or open issues or pull requests.
cad/ref/xcad-examples/PMPage/cs/Controls/WinFormsUserControl.cs
2022-10-15 19:16:08 +02:00

36 lines
867 B
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Xarial.XCad.UI.PropertyPage;
namespace Xarial.XCad.Examples.PMPage.CSharp.Controls
{
public partial class WinFormsUserControl : UserControl, IXCustomControl
{
public event Action<IXCustomControl, object> ValueChanged;
public WinFormsUserControl()
{
InitializeComponent();
}
public object Value
{
get => lblMsg.Text;
set => lblMsg.Text = value?.ToString();
}
private void OnClick(object sender, EventArgs e)
{
Value = Guid.NewGuid().ToString();
ValueChanged?.Invoke(this, Value);
}
}
}