Exemple #1
0
        public ABCChatArea(ABCChatBox form, String strUser2)
        {
            ChatBox = form;
            InitializeComponent();

            this.GotFocus += new EventHandler(ABCChatArea_GotFocus);

            this.gridContentView.OptionsView.RowAutoHeight = true;
            this.gridContentView.FocusRectStyle            = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.None;
            this.gridContentView.OptionsSelection.EnableAppearanceFocusedCell = false;
            this.gridContentView.OptionsSelection.EnableAppearanceFocusedRow  = false;
            this.gridContentView.CustomDrawCell += new DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventHandler(gridContentView_CustomDrawCell);
            this.gridContentView.GotFocus       += new EventHandler(gridContentView_GotFocus);

            this.ChatAreaContent.Properties.LinesCount      = 0;
            this.ChatAreaContent.Properties.NullValuePrompt = "nhập nội dung ....";
            this.ChatAreaContent.PreviewKeyDown            += new PreviewKeyDownEventHandler(memoEdit1_PreviewKeyDown);
            this.ChatAreaContent.KeyUp                 += new KeyEventHandler(memoEdit1_KeyUp);
            this.ChatAreaContent.GotFocus              += new EventHandler(ChatAreaContent_GotFocus);
            this.colEmployee.OptionsColumn.AllowEdit    = false;
            this.colChatContent.OptionsColumn.AllowEdit = true;
            this.colChatContent.OptionsColumn.ReadOnly  = true;

            this.colEmployee.AppearanceCell.TextOptions.VAlignment    = DevExpress.Utils.VertAlignment.Top;
            this.colChatContent.AppearanceCell.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Top;

            Initialize(ABCUserProvider.CurrentUserName, strUser2);

            this.txtUser.Text = EmployeeName2;

            InitDrag();
        }
Exemple #2
0
        public void OpenChatBox(String strFiendUser)
        {
            if (new ADUsersController().GetObjectByNo(strFiendUser) == null)
            {
                return;
            }

            if (ChatList.ContainsKey(strFiendUser) == false)
            {
                ABCChatBox chatbox = new ABCChatBox(this, strFiendUser);
                ChatList.Add(strFiendUser, chatbox);

                DevExpress.XtraTab.XtraTabPage page = new DevExpress.XtraTab.XtraTabPage();
                page.Text    = chatbox.ChatArea.EmployeeName2;
                chatbox.Dock = DockStyle.Fill;
                page.Controls.Add(chatbox);
                xtraTabControl1.TabPages.Add(page);

                ActiveChatPanel(strFiendUser);
            }
        }