윈폼 프로젝트에서는 버튼의 텍스트 출력은 다중으로 출력이 가능합니다.
그러나 .net compact framework을 이용한 PDA 프로그램에서는 버튼의 텍스트가 다중출력이 되지 않고 한줄로 출력이 됩니다.
그러다보니 텍스트 길이따라 짤리는 경우가 발생합니다.
아래의 소스는 coredll.dll API를 이용하여 버튼의 텍스트를 다중 출력해주는 코드이오니 업무에 참고하세요.
//WIN CE.NET/WINDOWS MOBILE 프로그램 개발 시 버튼의 텍스트를 한줄 이상으로 출력시 사용하는 API 및 예제
private const int BS_MULTILINE = 0x00002000;
private const int GWL_STYLE = -16;
[System.Runtime.InteropServices.DllImport("coredll.dll")]
private int GetWindowLong(IntPtr hWnd, int nIndex);
[System.Runtime.InteropServices.DllImport("coredll.dll")]
private int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
public static void MakeButtonMultiline(System.Windows.Forms.Button b)
{
IntPtr hwnd = b.Handle;
int currentStyle = GetWindowLong(hwnd, GWL_STYLE);
int newStyle = SetWindowLong(hwnd, GWL_STYLE, currentStyle | BS_MULTILINE);
}
'C#' 카테고리의 다른 글
PDA 화면 캡쳐 유틸프로그램 (0) | 2016.01.18 |
---|---|
[C#/PDA]MessageBox Auto Closing (0) | 2016.01.18 |
[C#]동호회 회원관리 프로그램 소개 (0) | 2016.01.15 |
[C#/PDA]PDA에서 실행 파일 경로 얻어오기 (0) | 2016.01.15 |
[C#/PDA]PDA에 장착된 카메라를 이용한 사진 촬영 예제 소스 (0) | 2016.01.15 |