Programming/WinForm

Load a Cursor from a Resources in C#

blueasa 2014. 11. 7. 01:02

WinForm에서 커서 파일을 Resources에 넣고 쓰는 방법(VS2013 한글판 기준)


[설정]

1. 프로젝트-(맨아래)프로젝트 속성 Click or 솔루션 탐색기-해당 프로젝트에서 우클릭-속성 Click

2. 리소스-리소스 추가(R) 우측의 화살표 Click

3. 기존 파일 추가(E) Click

4. 원하는 커서 파일(*.cur) 선택해서 추가.(예: Arrow.cur 추가)


[사용방법]

5. 커서를 사용하는 곳에 대입.

    예) Cursor myCursor = new Cursor(new System.IO.MemoryStream(Properties.Resources.Arrow));



참조 : http://csharphelper.com/blog/2013/03/load-a-cursor-from-a-resource-in-c/

반응형