Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms).
Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms).
Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms).
Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms).
Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms).
Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms). Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms). Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms). Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms). Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms). Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms). Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms). Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms).
Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms). Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms).
Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms).
Go Back  Xtreme Visual Basic Talk > > > Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms).


Reply
 
Thread Tools Display Modes
  #1  
Old 08-04-2012, 10:57 AM
priyamtheone priyamtheone is offline
Regular
 
Join Date: May 2008
Posts: 72
Question Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms).


I am rendering a toolstrip with a CustomRenderer that inherits from ToolStripProfessionalRenderer. The concept is that I want the color of the arrow of the toolstrip items to be white in all cases except selection. When it is selected the color should be black. In my code below all arrows are painted accordingly except the ToolStripComboBox where the color of the arrow always remains the same; the default one. How to sort it out?

Hope I don't need to write the whole class but only the relevant fragment. So I uploaded the OnRenderArrow method only.

Code:
Friend Class CustomRenderer
    Inherits ToolStripProfessionalRenderer

    Sub New()
        
    End Sub

    Protected Overrides Sub OnRenderArrow(ByVal e As System.Windows.Forms.ToolStripArrowRenderEventArgs)
        If e.Item.Pressed Then
            e.ArrowColor = Color.White
        ElseIf e.Item.Selected Then
            e.ArrowColor = SystemColors.ControlText
        Else
            e.ArrowColor = Color.White
        End If

        MyBase.OnRenderArrow(e)
    End Sub
End Class
To render the toolstrip with the pertinent class:

Code:
MyToolStrip.Renderer = New CustomRenderer
Reply With Quote
  #2  
Old 08-25-2012, 11:00 AM
priyamtheone priyamtheone is offline
Regular
 
Join Date: May 2008
Posts: 72
Default

ToolStripComboBox is a regular ComboBox that is hosted in a ToolStripControlHost. ToolStripItem arrows is as mentioned the menu children indicators and is not related to that. You may be able to utilize the code to custom paint ComboBox here: Painting right arrow in ToolStripComboBox
Reply With Quote
Reply

Tags
.net 4.0, csharp, visual basic 2010, visual studio 2010


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms).
Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms).
Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms). Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms).
Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms).
Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms).
Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms). Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms). Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms). Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms). Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms). Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms). Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms).
Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms).
Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms).
 
Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms).
Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms).
 
-->