Example #1
0
File: Main.cs Project: 7474/SRC
        internal void UpdateHotPointTooltip()
        {
            // ホットポイントが定義されている場合はツールチップを変更
            foreach (var hpoint in SRC.Event.HotPointList)
            {
                if (hpoint.Left <= GUI.MouseX && GUI.MouseX < hpoint.Left + hpoint.Width && hpoint.Top <= GUI.MouseY && GUI.MouseY < hpoint.Top + hpoint.Height)
                {
                    if (hpoint.Caption == "非表示" || string.IsNullOrEmpty(hpoint.Caption))
                    {
                        break;
                    }

                    if (hpoint.Name != LastHostSpot && !string.IsNullOrEmpty(LastHostSpot))
                    {
                        break;
                    }

                    // ツールチップの表示
                    ToolTip1.Show(hpoint.Caption, this, (int)GUI.MouseX, (int)GUI.MouseY);
                    // ここではマウスイベントを処理しつつカーソルの状態を変えるのでグローバルなカーソル状態操作にはしない
                    picMain.Cursor = Cursors.Hand;
                    LastHostSpot   = hpoint.Name;
                    return;
                }
            }

            // ホットポイント上にカーソルがなければツールチップを消す
            HideToolTip();
            return;
        }
Example #2
0
        private void txtCreateAccountRetypePassword_Leave(object sender, EventArgs e)
        {
            String retype_password = txtCreateAccountRetypePassword.Text;

            // Khi ô Text này rỗng thì sẽ thông báo, và không xử lý
            if (retype_password == "")
            {
                ToolTip1.Show("Sorry, The password is not null", txtCreateAccountRetypePassword);
                //Xử lý cho thay đổi label kết quả kế bên textbox
                lblResult_RetypePassword.ForeColor = Color.Red;
                lblResult_RetypePassword.Text      = "!";
                CreateAccountRetypePassword_Error  = true;
                return;
            }

            if (!retype_password.Equals(txtCreateAccountPassword.Text))
            {
                //Xử lý cho thay đổi label kết quả kế bên textbox
                lblResult_RetypePassword.ForeColor = Color.Red;
                lblResult_RetypePassword.Text      = "!";
                lblResult_RetypePassword_.Text     = "Retype password is not matched";
                lblResult_RetypePassword_.Visible  = true;
                CreateAccountRetypePassword_Error  = true;
                return;
            }
            CreateAccountRetypePassword_Error   = false;
            lblResult_RetypePassword.ForeColor  = Color.Green;
            lblResult_RetypePassword.Text       = "o";
            lblResult_RetypePassword_.ForeColor = Color.Green;
            lblResult_RetypePassword_.Text      = "Retype password is matched";
            lblResult_RetypePassword_.Visible   = true;
        }
Example #3
0
        private void txtCreateAccountPassword_Leave(object sender, EventArgs e)
        {
            String password = txtCreateAccountPassword.Text;

            // Khi ô Text này rỗng thì sẽ thông báo, và không xử lý
            if (password == "")
            {
                ToolTip1.Show("Sorry, The password is not null", txtCreateAccountPassword);
                //Xử lý cho thay đổi label kết quả kế bên textbox
                lblResult_Password.ForeColor = Color.Red;
                lblResult_Password.Text      = "!";
                CreateAccountPassword_Error  = true;
                return;
            }

            if (password.Length <= 5)
            {
                ToolTip1.Show("Sorry, The password is least 6 characters", txtCreateAccountPassword);
                //Xử lý cho thay đổi label kết quả kế bên textbox
                lblResult_Password.ForeColor = Color.Red;
                lblResult_Password.Text      = "!";
                CreateAccountPassword_Error  = true;
                return;
            }
            lblResult_Password.ForeColor = Color.Green;
            lblResult_Password.Text      = "o";
            CreateAccountPassword_Error  = false;
        }
Example #4
0
        private void txtCreateAccountEmail_Leave(object sender, EventArgs e)
        {
            String email = txtCreateAccountEmail.Text;

            // Khi ô Text này rỗng thì sẽ thông báo, và không xử lý
            if (email == "")
            {
                ToolTip1.Show("Sorry, The email is not null", txtCreateAccountEmail);
                //Xử lý cho thay đổi label kết quả kế bên textbox
                lblResult_Email.ForeColor = Color.Red;
                lblResult_Email.Text      = "!";
                CreateAccountEmail_Error  = true;
                return;
            }

            Regex match_email = new Regex(@"^[\w\.]+@[\w]+\.[\w]+"); // ^ bắt đầu bằng chữ, [\w] word (chữ, số, _) \. dấu chấm, + có một hoặc nhiều

            if (!match_email.IsMatch(email))
            {
                ToolTip1.Show("Sorry, The email is not match format", txtCreateAccountEmail);
                //Xử lý cho thay đổi label kết quả kế bên textbox
                lblResult_Email.ForeColor = Color.Red;
                lblResult_Email.Text      = "!";
                CreateAccountEmail_Error  = true;
                return;
            }

            lblResult_Email.ForeColor = Color.Green;
            lblResult_Email.Text      = "o";

            String checked_result = "";

            sent.Write("CheckEmail-Email=" + email);
            sent.Flush();
            //Chứa kết quả khi server phản hồi
            checked_result = received.ReadLine();
            received.DiscardBufferedData();

            // Username đã tồn tại
            if (checked_result.Contains("IsUsed"))
            {
                ToolTip1.Show("Sorry, it looks like " + email + " belongs to an existing !", txtCreateAccountEmail);
                CreateAccountEmail_Error = true;
                //Xử lý cho thay đổi label kết quả kế bên textbox
                lblResult_Email.ForeColor = Color.Red;
                lblResult_Email.Text      = "!!!";
                return;
            }
            else if (checked_result.Contains("NotUsed"))
            {
                CreateAccountEmail_Error = false;
                //Xử lý cho thay đổi label kết quả kế bên textbox
                lblResult_Email.Text      = "o";
                lblResult_Email.ForeColor = Color.Green;
                return;
            }
        }
Example #5
0
        private void WebBrowser_StatusTextChanged(object sender, EventArgs e)
        {
            var browser = (WebBrowser)sender;

            if (browser.StatusText.StartsWith("http"))
            {
                ToolTip1.Show(browser.StatusText, this, PointToClient(MousePosition));
            }
            else if (string.IsNullOrEmpty(DescriptionBrowser.StatusText))
            {
                ToolTip1.Hide(this);
            }
        }
Example #6
0
        private void txtCreateAccountName_Leave(object sender, EventArgs e)
        {
            String name = txtCreateAccountName.Text.Trim();

            // Khi ô Text này rỗng thì sẽ thông báo, và không xử lý
            if (name == "")
            {
                ToolTip1.Show("Sorry, The name is not null", txtCreateAccountName);
                //Xử lý cho thay đổi label kết quả kế bên textbox
                lblResult_Name.ForeColor = Color.Red;
                lblResult_Name.Text      = "!";
                CreateAccountName_Error  = true;
                return;
            }
            lblResult_Name.ForeColor = Color.Green;
            lblResult_Name.Text      = "o";
            CreateAccountName_Error  = false;
        }
Example #7
0
        /// <summary>
        ///  Hàm này xử lý khi TextBox Create Account Username mất Focus
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void txtCreateAccountUsername_Leave(object sender, EventArgs e)
        {
            String username = txtCreateAccountUsername.Text;

            // Khi ô Text này rỗng thì sẽ thông báo, và không xử lý
            if (username == "")
            {
                ToolTip1.Show("Sorry, The username is not null", txtCreateAccountUsername);
                //Xử lý cho thay đổi label kết quả kế bên textbox
                lblResult_Username.ForeColor = Color.Red;
                lblResult_Username.Text      = "!";
                CreateAccountUsername_Error  = true;
                return;
            }

            String checked_result = "";

            sent.Write("CheckUsername-Username="******"IsUsed"))
            {
                ToolTip1.Show("Sorry, it looks like " + username + " belongs to an existing account !", txtCreateAccountUsername);
                CreateAccountUsername_Error = true;
                //Xử lý cho thay đổi label kết quả kế bên textbox
                lblResult_Username.ForeColor = Color.Red;
                lblResult_Username.Text      = "!!!";
                return;
            }
            else if (checked_result.Contains("NotUsed"))
            {
                CreateAccountUsername_Error = false;
                //Xử lý cho thay đổi label kết quả kế bên textbox
                lblResult_Username.Text      = "o";
                lblResult_Username.ForeColor = Color.Green;
                return;
            }
            CreateAccountUsername_Error = false;
        }
Example #8
0
 public void ExportLayerComps_MouseHover(object sender, System.EventArgs e)
 {
     ToolTip1.Show("Export Layer Comps if checked, else it will save each layers", ExportLayerComps);
 }