반응형

C# -- winform 에서 double buffer 사용하기(deprecated)

 

 

참고 : https://www.youtube.com/watch?v=HQ0UYIuzucI

 

 

 

 

 

** double buffer 설정하는 다른 방법보다, 더 좋은듯... 

 

** DataGridView 에서 제대로 작동 안됨

반응형
Posted by 자유프로그램
,
반응형

C# -- 관리자 권한으로 실행되는 프로그램 만들기



참고 : http://softvernow.com/2018/07/26/start-c-application-with-admin-privileges/





1. 해당 프로젝트에 app.manifest  파일을 추가한다.





2. app.manifest 내용중에서

     <requestedExecutionLevel  level="asInvoker" uiAccess="false" />

   부분을

     <requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />

   로 바꾸고, rebuild 한다.







반응형
Posted by 자유프로그램
,
반응형

c# -- Generic List 내부의 객체 속성만 추출하여, List 만들기



< 실행 결과 >





< 소스코드 >

--





반응형
Posted by 자유프로그램
,
반응형

c# -- 객체 속성을 기준으로 Generic List 정렬하기



참고 : https://stackoverflow.com/questions/3309188/how-to-sort-a-listt-by-a-property-in-the-object




< 실행 결과 >




< 소스코드 >

--





반응형
Posted by 자유프로그램
,
반응형

C# -- 정렬가능한 양방항 binding DataGridView 만들기 

        (SortableBindingList 와 INotifyPropertyChanged 이용)



참고 :  http://martinwilley.com/net/code/forms/sortablebindinglist.html   ==> SortableBindingList 출처.

         https://docs.microsoft.com/ko-kr/dotnet/api/system.componentmodel.inotifypropertychanged?view=netframework-4.8

         

        https://scottlilly.com/learn-c-by-building-a-simple-rpg-index/lesson-20-3-binding-list-properties-to-datagridviews/




** DataGridView 의 DataSource 로 BindingList 사용시에는 정렬기능 없다.


   --> 이 문제를 해결한게 SortableBindingList 이다.

        ; BindingList 대신에 SrotableBindingList 사용하면 됨.




** DataGridView 에 연결한 DataSource 의 객체들 내부 속성에 변경사항이 생기면, 

    이를 즉시 DataGridView 화면에 반영하기위해서는, INotifyPropertyChanged 를 구현해야함.


   --> DataGridView 화면에서 수정한 경우에도, 해당 원본 객체의 속성에 잘 반영됨.




< 실행 화면 >




< 소스코드>

--



반응형
Posted by 자유프로그램
,