我正在 c#.net 中创建一个自定义消息框。
所以,我放置了一个“标签”并将其“文本”属性设置为等于通过 Show() 函数转发的消息。
代码看起来像这样 -----
public static void main(string msg)
{
Label txt=new Label();
txt.Text=msg;
txt.Location = new Point((m.Width/2-txt.Width/2), 100);
m.controls.Add(txt);
// here m is object of MsgBox
}
// calling of MsgBox is below
MsgBox.Show("This is a Line of Message to Show");
问题 MsgBox 只显示消息
“这是一条线”
以及如何将此标签放置在消息框中的中心(水平和垂直)。
所以请,如果你能帮我解决这个问题