1
为什么?.net自定义消息框文本突出显示
我构建了一个简单的自定义MessageBox作为C#中的对话框。当我通过Show()显示消息框时,消息文本不会突出显示。当我显示这个消息箱vi ShowDialog()时,文本是突出显示。
我不希望我的文本被突出显示。任何想法或想法?
public partial class MyMessageBox : Form
{
private String mCaption;
private String mMessage;
public MyMessageBox(Form anOwner, String aCaption, String aMessage)
{
InitializeComponent();
mCaption = aCaption;
Owner = anOwner;
mMessage = aMessage;
}
private void btnCancelRequest_Click(object sender, EventArgs e)
{
((AddressForm)Owner).RequestCancelled();
}
private void btnOk_Click(object sender, EventArgs e)
{
CloseDialog();
}
public void CloseDialog()
{
Close();
}
// Called from the Address Form
public void HideCancelRequestButton()
{
btnCancelRequest.Visible = false;
}
private void MyMessageBox_Activated(object sender, EventArgs e)
{
Text = mCaption;
txtMessage.Text = mMessage;
}
}
我从匈牙利符号猜测你的消息显示在名为txtMessage的TextBox控件中。为什么不用标签替换它? – 2012-01-30 00:10:36