dmdb/view/frmCommentChanges.cs

41 lines
1.3 KiB
C#

using System;
//using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace dezentrale.view
{
public class frmCommentChanges : FormWithActionButtons
{
public string Comment { get; private set; } = "";
private TextBox tbComment;
public frmCommentChanges(string captionEntity, string changes)
{
this.StartPosition = FormStartPosition.CenterParent;
this.Size = new System.Drawing.Size(800, 600);
this.Text = $"Comment changes to \"{captionEntity}\"";
int w = this.ClientSize.Width;
int h = this.ClientSize.Height - 35;
this.Controls.Add(tbComment = new TextBox()
{
Location = new Point(groupOffset, 0 * line + tm + groupOffset),
Size = new Size(w - 2 * groupOffset, h - 12 - tm),
Multiline = true,
ScrollBars = ScrollBars.Both,
Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom,
});
AddButton("Ok", btnOk_Click);
}
private void btnOk_Click(object sender, EventArgs e)
{
Comment = tbComment.Text.Replace("\r\n", "\n");
this.Close();
}
}
}