C#,Delphi,Oracle,MSSQL 개발자블로그
C# 우측하단에 알림창 띄우기. 본문
카카오톡에서 메세지가오면 우측 하단에 알림창이 뜨는 것 처럼, 폼을 하나 더 만들어서 띄운 후,
Timer를 이용하여 일정 시간 후 없어지게 한다.
public partial class Form1 : Form
{
Form2 frm = new Form2();
int timerCount = 0;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
timer1.Start();
System.Drawing.Rectangle ScreenRectangle = Screen.PrimaryScreen.WorkingArea;
int xPos = ScreenRectangle.Width - frm.Bounds.Width - 5;
int yPos = ScreenRectangle.Height - frm.Bounds.Height - 5;
frm.Show();
frm.SetBounds(xPos, yPos, frm.Size.Width, frm.Size.Height, BoundsSpecified.Location);
frm.BringToFront();
}
private void timer1_Tick(object sender, EventArgs e)
{
frm.Visible = false;
timer1.Stop();
}
}
'Programming > C#' 카테고리의 다른 글
C# - Oracle DB 연결하기.(ODP.NET이용) (0) | 2017.06.08 |
---|---|
C# DateTime을 이용해서 년도와 달을 알때, 마지막 날짜 구하기 (0) | 2017.06.08 |
C# URL 연결시 ,문자열 encoding 하기. (0) | 2017.04.14 |
C# String 정리.(substring, split, indexof) (0) | 2017.04.14 |
C# 텍스트 안에 ",\ 등 쓰는 법. (0) | 2017.03.12 |