I've been using a few custom controls that are freely available on the internet for custom tab controls and they're working great in certain conditions.
The control I'm using uses DrawMode=OwnerDrawFixed so it can design custom navigation buttons and that's working ok, even when i use SetParent() api. The problem is in the TabPages, they get overlayed and present a heavy flicker.
I did notice that when using DrawMode=Normal, the problem goes away, but then, the Custom Tab Control custom buttons disappear.
This is my custom TabPage I'm trying to use but so far the flicker didn't disappear
Any idea?Code:Imports System.Collections.Generic Imports System.ComponentModel Imports System.Drawing Imports System.Data Imports System.Text Imports System.Windows.Forms Imports System.Drawing.Design Imports System.Drawing.Drawing2D <System.ComponentModel.ToolboxItem(True)> Partial Public Class TabControl Inherits System.Windows.Forms.TabControl <Editor(GetType(TabPageCollectionEditor), GetType(UITypeEditor))> _ Public Shadows ReadOnly Property TabPages() As TabPageCollection Get Return MyBase.TabPages End Get End Property Sub New() Me.DrawMode = System.Windows.Forms.TabDrawMode.Normal End Sub Protected Shadows Sub OnDrawItem(ByVal sender As Object, ByVal e As DrawItemEventArgs) Dim page As TabPage = Me.TabPages(e.Index) Me.DrawMode = System.Windows.Forms.TabDrawMode.Normal e.Graphics.FillRectangle(New SolidBrush(page.BackColor), e.Bounds) End Sub End Class Public Class CustomTabPages Inherits System.Windows.Forms.TabPage Sub New() MyBase.New() MyBase.DoubleBuffered = True End Sub End Class Public Class TabPageCollectionEditor Inherits System.ComponentModel.Design.CollectionEditor Public Sub New(ByVal type As Type) MyBase.New(type) End Sub Protected Overrides Function CreateCollectionItemType() As System.Type Return GetType(TabPage) End Function Protected Overrides Function CreateNewItemTypes() As System.Type() Return New Type() {GetType(TabPage), GetType(CustomTabPages)} End Function End Class




and rating it.
Reply With Quote