본문 바로가기
반응형

백엔드159

Enum과 Component의 Tag 속성 사용자가 선택가능한 여러가지 모드가 존재한다고 했을때 이를 Enum 클래스로 만들어서 관리하면 좋다. 이렇게 Enum 클래스를 만들어놓은 경우 사용자가 모드를 선택할때 사용하는 버튼에 해당 Enum 값을 부여할수가 있는데 바로 Tag 속성에 해당 값을 넣어놓는것이다. Tag속성의 설명을 보면 사용자정의 값을 넣어놓는 어쩌고 하고 적혀있다. Enum값을 Tag에 넣어놓으면 해당 버튼이 클릭됐을때 Tag값을 꺼내서 해당 Enum값에 맞는 모드로 진행하도록 코드를 깔끔하게 짤 수가 있다. -> 클릭 이벤트 메서드 하나 만들어서 여러개에 달기 여기서 하나 더 안 사실은 라디오버튼이나 체크박스의 디스플레이타입을 버튼으로 변경할 수 있다는것이다. 이렇게 하면 라디오버튼의 개중에 하나만 체크된다 라던가 체크박스의 C.. 2019. 8. 11.
C# DateTime ToString Format DateTime클래스의 ToString에 출력 형식을 지정해 줄 수 있다. 기본적인 처리(5월이면 05로 출력되게 하고싶다 등)가 필요없다. https://docs.microsoft.com/ko-kr/dotnet/api/system.datetime.tostring?view=netframework-4.8 DateTime.ToString Method (System) 현재 개체의 값을 해당하는 문자열 표현으로 변환합니다.Converts the value of the current object to its equivalent string representation. docs.microsoft.com 2019. 8. 8.
using 키워드 - 자원의 해제 자원을 해제해줘야 하는 경우 using keyword를 사용한다. using 안에서 사용한 자원의 경우 해당 블록을 벗어나면 해제해주므로 습관을 들이면 좋겠다. https://youtu.be/vbVaBg3wPj4 https://genesis8.tistory.com/197 c# using 키워드 원문 : http://csharpschool.github.io/2015/05/05/using-keyword-and-idisposable.html C#에서는 가비지 컬렉터를 지원하므로, 메모리의 해제를 자동으로 해주지만 우리가 사용하는 리소스가 메모리만 있는 것이.. genesis8.tistory.com 2019. 8. 8.
ToolStripLabel BackColor 적용 ToolStrip Renderer를 "System"으로 변경하면 BackColor 속성이 적용된다. https://social.msdn.microsoft.com/Forums/windows/en-US/a976b38d-21c9-448f-b0ca-ab4bc1e87f89/toolstriplabel-backcolor-not-displayed?forum=winforms ToolStripLabel BackColor not displayed If you use the System renderer, you may change the appearance of the entire toolbar to a flat appearance. If you only want to draw the label in a colored rec.. 2019. 8. 6.
c# Graphics로 회전된 글자 그리기 Geometry 위에 글자를 표시할 일이 생겼다. 글자는 그리기가 어렵다. 글자는 기본적으로(g는 Graphics) g.DrawString(String, Font, Brush, RectangleF, StringFormat); 을 가지고 쓴다. 글자의 방향이나 이것저것 고려할것이 없다면 그냥 g.DrawString(String, Font, Brush, x, y); g.DrawString(String, Font, Brush, x, y, StringFormat); 등을 쓰면된다. 문제는 이 Geometry는 회전도 되고 방향도 존재한다. 1. 방향 방향의 경우 StringFormat의 Alignment, StringAlignment 속성을 사용해서 이동할 수 있다. Alignment: 세로 평면에 대한 텍스트.. 2019. 7. 19.
Polygon에 빗금치기 https://stackoverflow.com/questions/26257440/hatching-2d-polygon Hatching 2D polygon Given a 2D polygon made up of a set of points, I'm looking to draw hatching through the inside of the polygon. By hatching I mean evenly spaces lines, all at around 45 degrees. I'm having trouble stackoverflow.com 적재안되는 영역에 빗금을 치기로했다. 이걸 어떻게 한다~ 직접 구현해야하나 했는데 먼저 검색을 해보기로 했다. 검색어 1번. 빗금 영어 => Hatched 검색어 2번. C# P.. 2019. 7. 15.
반응형