/// <summary> /// 大于80行时清空消息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MemoMsg_TextChanged(object sender, EventArgs e) { try { if (MemoMsg.Lines.Length > 80) { MemoMsg.Clear(); } } finally { } }
/// <summary> /// 初始化 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void TfrmOnlineMsg_Load(object sender, EventArgs e) { dgvNoticeList.RowHeadersVisible = false; dgvNoticeList.SelectionMode = DataGridViewSelectionMode.FullRowSelect; dgvNoticeList.MultiSelect = false; dgvNoticeList.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells; dgvNoticeList.AllowUserToResizeColumns = false; dgvNoticeList.AllowUserToResizeRows = false; dgvNoticeList.AllowUserToAddRows = false; dgvNoticeList.ReadOnly = true; dgvNoticeList.ColumnHeadersVisible = false; StrList = new TStringList(); DataGridViewTextBoxColumn acCode = new DataGridViewTextBoxColumn(); acCode.Name = "List"; acCode.DataPropertyName = "List"; acCode.HeaderText = "公告列表"; acCode.SortMode = DataGridViewColumnSortMode.NotSortable; acCode.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; dgvNoticeList.Columns.Add(acCode); Refresh(); MemoMsg.Clear(); }