メッセンジャーのようなタスクバーのポップアップウィンドウを作成することができました。 タスクバーの後ろに消えずに下に移動したときに、タスクバーの後ろに移動するという問題。C#&WPF - タスクバーポップアップ通知ウィンドウの問題
タスクバーの後ろに消えるようにするにはどうすればよいですか?タスクバーが透明であることをWindows 7で忘れないでください!
public partial class WindowNotifier : Window
{
double xPos = 0;
double yPos = 0;
Timer closeTimer;
public WindowNotifier()
{
InitializeComponent();
closeTimer = new Timer();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
SetValues();
closeTimer.Tick+=new EventHandler(closeTimer_Tick);
closeTimer.Start();
}
private void SetValues()
{
xPos = System.Windows.SystemParameters.WorkArea.Width;
yPos = System.Windows.SystemParameters.WorkArea.Height;
this.Left = xPos - this.Width;
this.Top = yPos - this.Height;
}
private void closeTimer_Tick(object sender, EventArgs e)
{
closeTimer.Interval = 50;
double curYPos = this.Top;
if (curYPos < yPos)
{
this.Top = curYPos + 8;
this.Opacity = this.Opacity - 0.050;
}
else
{
this.Close();
}
}
}
EDIT:
は、ここに私のコードです 今、私は、コントロールの高さを低くし、それを再配置して、私はタイマー一部を変更しました。 問題は点滅することです。どうすれば解決できますか?ここで
はコードです:
closeTimer.Interval = 50;
double curYPos = this.Top;
int decAmount = 8;
if(this.Height - decAmount > 0)
{
this.Height = this.Height - decAmount;
this.Top = this.Top + decAmount;
this.Opacity = this.Opacity - 0.010;
}
else
{
this.Height = 0;
this.Close();
closeTimer.Stop();
}
あなたがいる間、異なるタスクバーの場所と画面を考慮に入れてください。私はあなたの現在のコードが特に最後のものにいくつかの予想外の影響を与えるかもしれないと思う。個人的には、私のタスクバーが左側にある間、右下を下に外してしまえば迷惑な気がする。私はそれが左にあり、左に消えていくことを期待しています。 – Stigma