첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170

▶ 태스크바 위치 타입 구하기 예제

TaskbarLocationType type = GetTaskbarLocationType();

 

728x90

 

▶ 태스크바 위치 타입 구하기

using System.Windows.Forms;

/// <summary>
/// 태스크바 위치 타입
/// </summary>
public enum TaskbarLocationType
{
    LEFT,
    TOP,
    RIGHT,
    BOTTOM
}

#region 태스크바 위치 타입 구하기 - GetTaskbarLocationType()

/// <summary>
/// 태스크바 위치 타입 구하기
/// </summary>
/// <returns>태스크바 위치 타입</returns>
public TaskbarLocationType GetTaskbarLocationType()
{
    TaskbarLocationType type = TaskbarLocationType.BOTTOM;

    bool isTopOrBottom = (Screen.PrimaryScreen.WorkingArea.Width == Screen.PrimaryScreen.Bounds.Width);

    if(isTopOrBottom)
    {
        if(Screen.PrimaryScreen.WorkingArea.Top > 0)
        {
            type = TaskbarLocationType.TOP;
        }
    }
    else
    {
        if(Screen.PrimaryScreen.WorkingArea.Left > 0)
        {
            type = TaskbarLocationType.LEFT;
        }
        else
        {
            type = TaskbarLocationType.RIGHT;
        }
    }

    return type;
}

#endregion
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요