Exemplo n.º 1
0
        private void PanelRegisterTxtChat_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == (char)13)
            {
                UserControlMessageUser userControlMessageUser = new UserControlMessageUser();
                userControlMessageUser.Message    = PanelRegisterTxtChat.Text;
                userControlMessageUser.PicProfile = profile_path;

                int ptop = 0;
                foreach (Control con in PanelRegisterChatPanel.Controls)
                {
                    if (con.Top + con.Height > ptop)
                    {
                        ptop = con.Top + con.Height;
                    }
                }
                userControlMessageUser.Top = ptop;
                PanelRegisterChatPanel.Controls.Add(userControlMessageUser);

                if (MessageOrder == Resource.SystemMessage.Count())
                {
                    PanelBMI.BringToFront();
                }
                else
                {
                    UserControlMessageSystem userControlMessageSystem = new UserControlMessageSystem();
                    userControlMessageSystem.Message = Resource.SystemMessage[MessageOrder];
                    userControlMessageSystem.Top     = ptop + userControlMessageUser.Height;
                    PanelRegisterChatPanel.Controls.Add(userControlMessageSystem);
                    MessageOrder++;
                    PanelRegisterTxtChat.Text = "";
                    PanelRegisterChatPanel.VerticalScroll.Maximum = 100;
                }
            }
        }
Exemplo n.º 2
0
        private void PanelRegisterMic_Click(object sender, EventArgs e)
        {
            if (PanelRegisterMic.BackColor == Color.Green)
            {
                PanelRegisterMic.BackColor = Color.FromArgb(238, 28, 36);
                PanelRegisterTxtChat.Text  = Resource.SystemMessageAnswer[MessageOrder - 1];
                UserControlMessageUser userControlMessageUser = new UserControlMessageUser();
                userControlMessageUser.Message    = PanelRegisterTxtChat.Text;
                userControlMessageUser.PicProfile = profile_path;

                int ptop = 0;
                foreach (Control con in PanelRegisterChatPanel.Controls)
                {
                    if (con.Top + con.Height > ptop)
                    {
                        ptop = con.Top + con.Height;
                    }
                }
                userControlMessageUser.Top = ptop;
                PanelRegisterChatPanel.Controls.Add(userControlMessageUser);

                UserControlMessageSystem userControlMessageSystem = new UserControlMessageSystem();
                userControlMessageSystem.Message = Resource.SystemMessage[MessageOrder];
                userControlMessageSystem.Top     = ptop + userControlMessageUser.Height;
                PanelRegisterChatPanel.Controls.Add(userControlMessageSystem);
                MessageOrder++;
                PanelRegisterTxtChat.Text = "";
                PanelRegisterChatPanel.VerticalScroll.Maximum = 100;

                if (MessageOrder == Resource.SystemMessage.Count())
                {
                    PanelBMI.BringToFront();
                }
            }
            else
            {
                PanelRegisterMic.BackColor = Color.Green;
            }
        }
Exemplo n.º 3
0
        private void PanelRegisterAttachment_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();

            dialog.Filter           = "Image Files|*.jpg;*.jpeg;*.png;";
            dialog.InitialDirectory = @"C:\";
            dialog.Title            = "Please select an image file.";
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                UserControlMessageUserPic userControlUserMessagePic = new UserControlMessageUserPic();
                userControlUserMessagePic.Path = dialog.FileName;

                int ptop = 0;
                foreach (Control con in PanelRegisterChatPanel.Controls)
                {
                    if (con.Top + con.Height > ptop)
                    {
                        ptop = con.Top + con.Height;
                    }
                }
                userControlUserMessagePic.Top = ptop;
                PanelRegisterChatPanel.Controls.Add(userControlUserMessagePic);
                profile_path = dialog.FileName;
                PanelRegisterTxtChat.Text = "";

                UserControlMessageSystem userControlMessageSystem = new UserControlMessageSystem();
                userControlMessageSystem.Message = Resource.SystemMessage[MessageOrder];
                userControlMessageSystem.Top     = ptop + userControlUserMessagePic.Height;
                PanelRegisterChatPanel.Controls.Add(userControlMessageSystem);
                MessageOrder++;

                if (MessageOrder == Resource.SystemMessage.Count())
                {
                    PanelBMI.BringToFront();
                }
            }
        }
Exemplo n.º 4
0
 private void pictureBox4_Click(object sender, EventArgs e)
 {
     PanelBMI.BringToFront();
 }