작업트레이위에 스르륵!! 나타나는 폼!
# 2) .Net ( Vs 2005 )/WinForm2009. 10. 6. 19:33
전에 만들었던 폼에서 좀 다르게 작업되었지만. 간소화 시켰음.
작업 트레이 바로 위에서 오르락~ 내리락~!! 하는 폼 작업해봤음.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace OnTrayForm
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.StartPosition = FormStartPosition.Manual;
this.Left = Screen.PrimaryScreen.WorkingArea.Right - this.Width;
this.Top = Screen.PrimaryScreen.WorkingArea.Bottom;
}
protected override void OnShown(EventArgs e)
{
this.Left = Screen.PrimaryScreen.WorkingArea.Right - this.Width;
this.Top = Screen.PrimaryScreen.WorkingArea.Bottom;
Timer tm = new Timer();
tm.Interval = 30;
tm.Tick += delegate(object se, EventArgs ea)
{
if (this.Top > ( Screen.PrimaryScreen.WorkingArea.Bottom - this.Height + 5))
this.Top -= (this.Height / 15);
else
{
this.TopMost = true;
this.Top = Screen.PrimaryScreen.WorkingArea.Bottom - this.Height;
tm.Stop();
tm.Dispose();
tm = null;
}
};
tm.Start();
}
bool closing = false;
protected override void OnFormClosing(FormClosingEventArgs e)
{
if( closing == false )
e.Cancel = true;
this.Left = Screen.PrimaryScreen.WorkingArea.Right - this.Width;
this.Top = Screen.PrimaryScreen.WorkingArea.Bottom - this.Height;
Timer tm = new Timer();
tm.Interval = 30;
tm.Tick += delegate(object se, EventArgs ea)
{
if (this.Top <= (Screen.PrimaryScreen.WorkingArea.Bottom + 5))
this.Top += (this.Height / 15);
else
{
this.Top = Screen.PrimaryScreen.WorkingArea.Bottom;
tm.Stop();
tm.Dispose();
tm = null;
closing = true;
this.Hide();
this.Close();
}
};
this.TopMost = false;
tm.Start();
}
}
}
작업 트레이 바로 위에서 오르락~ 내리락~!! 하는 폼 작업해봤음.
<< 동작 화면... >>
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace OnTrayForm
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.StartPosition = FormStartPosition.Manual;
this.Left = Screen.PrimaryScreen.WorkingArea.Right - this.Width;
this.Top = Screen.PrimaryScreen.WorkingArea.Bottom;
}
protected override void OnShown(EventArgs e)
{
this.Left = Screen.PrimaryScreen.WorkingArea.Right - this.Width;
this.Top = Screen.PrimaryScreen.WorkingArea.Bottom;
Timer tm = new Timer();
tm.Interval = 30;
tm.Tick += delegate(object se, EventArgs ea)
{
if (this.Top > ( Screen.PrimaryScreen.WorkingArea.Bottom - this.Height + 5))
this.Top -= (this.Height / 15);
else
{
this.TopMost = true;
this.Top = Screen.PrimaryScreen.WorkingArea.Bottom - this.Height;
tm.Stop();
tm.Dispose();
tm = null;
}
};
tm.Start();
}
bool closing = false;
protected override void OnFormClosing(FormClosingEventArgs e)
{
if( closing == false )
e.Cancel = true;
this.Left = Screen.PrimaryScreen.WorkingArea.Right - this.Width;
this.Top = Screen.PrimaryScreen.WorkingArea.Bottom - this.Height;
Timer tm = new Timer();
tm.Interval = 30;
tm.Tick += delegate(object se, EventArgs ea)
{
if (this.Top <= (Screen.PrimaryScreen.WorkingArea.Bottom + 5))
this.Top += (this.Height / 15);
else
{
this.Top = Screen.PrimaryScreen.WorkingArea.Bottom;
tm.Stop();
tm.Dispose();
tm = null;
closing = true;
this.Hide();
this.Close();
}
};
this.TopMost = false;
tm.Start();
}
}
}
'# 2) .Net ( Vs 2005 ) > WinForm' 카테고리의 다른 글
텍스트박스 라인넘버 넣기! (0) | 2009.10.26 |
---|---|
디버그윈도우를 만들어서 적용함. (0) | 2009.10.16 |
가상메서드 - 오버라이드... (0) | 2009.10.06 |
그리드뷰 각 Row색 바꾸기. (1) | 2009.09.25 |
Win Form이 스윽~~ 나오는 효과내기 (0) | 2009.09.23 |