■ 디자인 모드 여부를 구하는 방법을 보여준다.
▶ 예제 코드 (C#)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
using System; using System.Windows.Forms; #region 디자인 모드 여부 구하기 - IsInDesignMode() /// <summary> /// 디자인 모드 여부 구하기 /// </summary> /// <returns>디자인 모드 여부</returns> public bool IsInDesignMode() { if(Application.ExecutablePath.IndexOf("devenv.exe", StringComparison.OrdinalIgnoreCase) > -1) { return true; } return false; } #endregion |