2012-08-09 1 views
1

WinCE 6.0 프로젝트 (Compact Framework 3.5)에서 작업 중입니다. 이제 ListView 컨트롤의 스타일 (스크롤 막대)을 변경하려고합니다. 하지만 .OwnerDraw() 메서드가 없기 때문에 내 자신의 스타일을 그릴 수 없습니다. CF 3.5를 사용하여 ListView의 스타일을 사용자 정의 할 수 있습니까? (특히 스크롤바 스타일과 선택한 항목 배경색).스타일리스트 ListView Controle with Compact Framwork 3.5

답변

1

이 방법은 상속의 ListView에서 스크롤 막대를 제거합니다

const int GWL_STYLE = -16; 
//No ScrollBar 
const int LVS_NOSCROLL = 0x2000; 
private bool noScrollBar = false; 
    public bool NoScrollBar 
    { 
     get { return noScrollBar; } 
     set 
     { 
      noScrollBar = value; 
      int style = (int)NativeMethods.GetWindowLong(Handle, GWL_STYLE); 
      if (noScrollBar) 
      { 
       NativeMethods.SetWindowLong(Handle, GWL_STYLE, style | LVS_NOSCROLL); 
      } 
      else 
      { 
       NativeMethods.SetWindowLong(Handle, GWL_STYLE, style & ~LVS_NOSCROLL); 
      } 
     } 
    } 

어쩌면 당신은 당신의 필요에 따라 편집 할 수 있습니다.