string str1 ="";
using (StreamReader str = new StreamReader("回忆站.txt", System.Text.Encoding.UTF8))
{
string line;
while ((line = str.ReadLine()) != null)
{
str1 = str1 line "\r\n";
}
CCSkinMain MessageboxForm = new CCSkinMain();
MessageboxForm.MinimizeBox = false;
MessageboxForm.MaximizeBox = false;
MessageboxForm.ControlBox = true;
MessageboxForm.Location = new Point(100, 200);
MessageboxForm.Width = 400;
MessageboxForm.Height = 200;
MessageboxForm.BackColor = ColorTranslator.FromHtml(backcolor);
// MessageboxForm.BackgroundImage = Image.FromFile(filepath);
MessageboxForm.Text ="回忆站";
MessageboxForm.ControlBox = false;
MessageboxForm.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
MessageboxForm.ShowDrawIcon = false;
RichTextBox rt = new RichTextBox();
rt.Text = str1;
rt.Left = 20;
rt.Top = 30;
rt.Parent = MessageboxForm;
rt.Size = new Size(350, 100);
rt.BackColor = BackColor = ColorTranslator.FromHtml(backcolor);
rt.BorderStyle = BorderStyle.None;
Button btnok = new Button();
btnok.Left = 110;
btnok.Top = 160;
btnok.Parent = MessageboxForm;
btnok.Text = "确定";
MessageboxForm.AcceptButton = btnok;
btnok.DialogResult = DialogResult.OK;
btnok.FlatStyle = FlatStyle.Flat;
//btnok.ForeColor = Color();
btnok.BackColor = Color.Transparent;
btnok.FlatAppearance.BorderSize = 1;
try
{
if (MessageboxForm.ShowDialog() == DialogResult.OK)
{
MessageboxForm.Close();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
str.Close();
}
评论