📄 formsendmsggroup.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace LanMsg
{
public partial class FormSendMsgGroup : DevComponents .DotNetBar.Office2007Form // Form
{
public FormSendMsgGroup()
{
InitializeComponent();
this.cBoxMsgInfo.SelectedIndex=0;
}
private void FormSendMsgGroup_Load(object sender, EventArgs e)
{
FormAccess.formMain.TreeUsers.CheckBoxes = true;
}
private void butSend_Click(object sender, EventArgs e)
{
if (this.RTBSendContent.Text.Trim() == "")
{
MessageBox.Show("不能发送空消息。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
dataAccess.addMsgToDB(this.RTBSendContent.Text.TrimEnd(), FormAccess.selfInfo.UserID ,"", "1", System.DateTime.Now.ToString(), "", false);
IMLibrary.clientMsg msg=new IMLibrary.clientMsg(this.RTBSendContent.Text.TrimEnd(),FormAccess.selfInfo.UserID );
FormAccess.sendMsgToAllCheckUser(15, IMLibrary.Serializers.ObjToByte(msg));
MessageBox.Show("消息已经发送。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.RTBSendContent.Clear();
this.Close();
this.Dispose();
}
private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
{
bool t = true;
if (this.RTBSendContent.SelectedText.Length == 0)
t = false;
this.MenuItemCopy.Visible = t;
this.MenuItemCut.Visible = t;
this.MenuItemDel.Visible = t;
}
private void contextMenuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
switch (e.ClickedItem.Name)
{
case "MenuItemCopy":
this.RTBSendContent.Copy();
break;
case "MenuItemPaset":
this.RTBSendContent.Paste();
break;
case "MenuItemCut":
this.RTBSendContent.Cut();
break;
case "MenuItemDel":
this.RTBSendContent.SelectedText = "";
break;
case "MenuItemSelAll":
this.Focus();
this.RTBSendContent.SelectAll();
break;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -