2016-11-20 1 views
0

내 응용 프로그램에서 menustrip 추가 및 menustrip 변경 테두리 색을 싶습니다. 몇 가지 코드를 찾았지만 그림에서 보더를 다시 볼 수 있습니다.VB 색 테두리 menustrip 변경

사진 :

enter image description here

내 코드 :

Public Class ColorTable 
    Inherits ProfessionalColorTable 

    Dim Color1 = Color.FromArgb(30, 38, 44) 
    Dim Color2 = Color.FromArgb(75, 81, 88) 

    Public Overrides ReadOnly Property MenuBorder() As Color 
     Get 
      Return Color1 
     End Get 
    End Property 

    Public Overrides ReadOnly Property MenuItemSelectedGradientBegin() As Color 
     Get 
      Return Color2 
     End Get 
    End Property 

    Public Overrides ReadOnly Property MenuItemSelectedGradientEnd() As Color 
     Get 
      Return Color2 
     End Get 
    End Property 

    Public Overrides ReadOnly Property MenuItemSelected() As Color 
     Get 
      Return Color2 
     End Get 
    End Property 

    Public Overrides ReadOnly Property MenuItemBorder() As Color 
     Get 
      Return Color1 
     End Get 
    End Property 

    Public Overrides ReadOnly Property MenuItemPressedGradientBegin() As Color 
     Get 
      Return Color2 
     End Get 
    End Property 

    Public Overrides ReadOnly Property MenuItemPressedGradientEnd() As Color 
     Get 
      Return Color2 
     End Get 
    End Property 

End Class 

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 
    Menus.Renderer = New ToolStripProfessionalRenderer(New ColorTable()) 
End Sub 
+0

당신이 * 변경 * 테두리 색상 또는 * * 국경을 제거 하시겠습니까. 문제는 명확하지 않습니다. 코드가 작동하는 것처럼 보입니다. – Plutonix

+0

흰색 테두리를 제거하고 싶습니다. – Musyanon

답변

0

당신은 또한 다음과 같은 속성을 오버라이드 (override) 할 예정 :

Public Overrides ReadOnly Property SeparatorDark() As Color 
    Get 
     Return Color1 
    End Get 
End Property 

Public Overrides ReadOnly Property ToolStripDropDownBackground() As Color 
    Get 
     Return Color1 
    End Get 
End Property 

이 배경 다룰 것입니다 및 추가 할 분리 기호.

+0

도움을 주셔서 감사합니다. 지금 가지고 있습니다 : http://image.prntscr.com/image/086ee3794d5d4471a6df7e7531afb000.jpg – Musyanon

0

나는

 Public Overrides ReadOnly Property ImageMarginGradientBegin() As System.Drawing.Color 
     Get 
      Return Color1 
     End Get 
    End Property 
    Public Overrides ReadOnly Property ImageMarginGradientEnd() As System.Drawing.Color 
     Get 
      Return Color1 
     End Get 
    End Property 
    Public Overrides ReadOnly Property ImageMarginGradientMiddle() As System.Drawing.Color 
     Get 
      Return Color1 
     End Get 
    End Property 

를 추가하고 이제 모든 괜찮습니다 :)