Пример #1
0
        public FileTooltip(string[] files)
        {
            #region control related
            InitializeComponent();
            MouseEnter += new MouseEventHandler(MyCustomTooltip_MouseEnter);
            MouseLeave += new MouseEventHandler(MyCustomTooltip_MouseLeave);
               // this.AllowsTransparency = true;
               // base.CoerceValue(HasDropShadowProperty);
               // base.SetValue(HasDropShadowProperty, true);

            this.SetResourceReference(Popup.PopupAnimationProperty, SystemParameters.ToolTipPopupAnimationKey);

            close_timer.Elapsed += new System.Timers.ElapsedEventHandler(close_timer_Elapsed);
            close_timer.Interval = 200;

            if (SystemParameters.DropShadow)
            {
                ToolTipService.SetHasDropShadow(this, true);
            }

            #endregion

            this.files = files;
               Thread thr = new Thread(PreapreFilesInfo);

            thr.Start();
            if (instance != null)
            {
                instance.IsOpen = false;
                instance.close_timer.Enabled = false;
            }

            this.Opened += new EventHandler(MyCustomTooltip_Opened);

            instance = this;
        }
Пример #2
0
 void MyCustomTooltip_Opened(object sender, EventArgs e)
 {
     if (instance != null && instance != this)
     {
         instance.IsOpen = false;
         instance.close_timer.Enabled = false;
     }
     instance = this;
     Focus();
     Fileslist.Focus();
 }