Exemplo n.º 1
0
        /// <summary>
        /// Filters out a message before it is dispatched.
        /// </summary>
        /// <param name="m">The message to be dispatched. You cannot modify this message.</param>
        /// <returns>
        /// Boolean true to filter the message and stop it from being dispatched;
        /// false to allow the message to continue to the next filter or control.
        /// </returns>
        public bool PreFilterMessage(ref Message m)
        {
            if (Visible && (ActiveForm == null || !ActiveForm.Equals(this)))
            {
                Visible = false;
                Close();
            }

            if (m.Msg == WM_NCLBUTTONDOWN)
            {
                if ((int)m.WParam == HTCAPTION)
                {
                    Visible = false;
                }
            }

            if (m.Msg == WM_NCMOUSELEAVE)
            {
                if (!Visible)
                {
                    Close();
                }
            }

            return(false);
        }
Exemplo n.º 2
0
 private void refreshUserSetting()
 {
     if (_UcDate == null || ActiveForm == null)
     {
         return;
     }
     if (!ActiveForm.Equals(this))
     {
         this.Hide();
         return;
     }
     if (radValue.Checked)
     {
         _UcDate.DateFilterType = _BindingFixedValue[_CurIndex];
     }
     else
     {
         foreach (RadioButton button in _BindingRadAndType.Keys)
         {
             if (button.Checked)
             {
                 _UcDate.DateFilterType = _BindingRadAndType[button];
                 break;
             }
         }
         if (_UcDate.DateFilterType == ucEditDateFilter.DateFilterEditType.Other)
         {
             _UcDate.DateFilterValue = new MB.Util.Model.DateFilterStruct(dTimeBegin.DateTime, dTimeEnd.DateTime);
         }
     }
 }
Exemplo n.º 3
0
            public bool PreFilterMessage(ref Message m)
            {
                if (!Freeze && Visible && (ActiveForm == null || !ActiveForm.Equals(this)))
                {
                    OnDropStateChange(eDropState.Closing);
                    Close();
                }


                return(false);
            }