VB.net 2005 Tabcontrol

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steve

    #1

    VB.net 2005 Tabcontrol

    Hi All

    Is there any way to change the colour of the Tabcontrol Tab header strip

    I have found how to override the individual Tab header colours in the
    drawitem event but the rest of the Tabcontrol's Tab header is the default
    windows control colour

    If the Tab headers don't fill the Tabcontrol header strip it looks tacky

    Failing this can anybody recommend a 3rd party Tabcontrol with can be
    customised better

    Regards
    Steve


  • Linda Liu[MSFT]

    #2
    RE: VB.net 2005 Tabcontrol

    Hi Steve,

    I searched the Internet and found a sample of a TabControl with owner-drawn
    tabs. You may visit the following link for more information:



    Hope this helps.
    If you have any question, please feel free to let me know.

    Sincerely,
    Linda Liu
    Microsoft Online Community Support

    Delighting our customers is our #1 priority. We welcome your comments and
    suggestions about how we can improve the support we provide to you. Please
    feel free to let my manager know what you think of the level of service
    provided. You can send feedback directly to my manager at:
    msdnmg@microsof t.com.

    =============== =============== =============== =====
    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscripti...ult.aspx#notif
    ications.

    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/subscripti...t/default.aspx.
    =============== =============== =============== =====
    This posting is provided "AS IS" with no warranties, and confers no rights.


    Comment

    • Steve

      #3
      Re: VB.net 2005 Tabcontrol

      Hi Linda

      Thats not what I need

      I need to change the colour of the Tabcontrol Tab bar, i.e the header where
      all the Tabpage headers sit, not the Tabpages themselves

      If you get a Tabcontrol and put 2 or 3 tabpages on it, the space after the
      last Tabpage header is a default colour which I need to change

      Regards
      Steve

      "Linda Liu[MSFT]" <v-lliu@online.mic rosoft.comwrote in message
      news:hCVj5LfpIH A.1788@TK2MSFTN GHUB02.phx.gbl. ..
      Hi Steve,
      >
      I searched the Internet and found a sample of a TabControl with
      owner-drawn
      tabs. You may visit the following link for more information:
      >

      >
      Hope this helps.
      If you have any question, please feel free to let me know.
      >
      Sincerely,
      Linda Liu
      Microsoft Online Community Support
      >
      Delighting our customers is our #1 priority. We welcome your comments and
      suggestions about how we can improve the support we provide to you. Please
      feel free to let my manager know what you think of the level of service
      provided. You can send feedback directly to my manager at:
      msdnmg@microsof t.com.
      >
      =============== =============== =============== =====
      Get notification to my posts through email? Please refer to
      http://msdn.microsoft.com/subscripti...ult.aspx#notif
      ications.
      >
      Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
      where an initial response from the community or a Microsoft Support
      Engineer within 1 business day is acceptable. Please note that each follow
      up response may take approximately 2 business days as the support
      professional working with you may need further investigation to reach the
      most efficient resolution. The offering is not appropriate for situations
      that require urgent, real-time or phone-based interactions or complex
      project analysis and dump analysis issues. Issues of this nature are best
      handled working with a dedicated Microsoft Support Engineer by contacting
      Microsoft Customer Support Services (CSS) at
      http://msdn.microsoft.com/subscripti...t/default.aspx.
      =============== =============== =============== =====
      This posting is provided "AS IS" with no warranties, and confers no
      rights.
      >
      >

      Comment

      • Linda Liu[MSFT]

        #4
        Re: VB.net 2005 Tabcontrol

        Hi Steve,

        Thank you for your prompt reply!

        To get what you want, you need to get the rectangle representing the
        TabControl's header strip first and then create a GraphicsPath object. Add
        the header strip rectangle and all the tab rectangles to the GraphicsPath
        object. Then fill the GraphicsPath object with the color you want. By
        default, the FillMode property of a GraphicsPath is Alternate, which means
        the overlap is subtractive.

        The following is a sample:
        Private Sub TabControl1_Dra wItem(ByVal sender As Object, ByVal e As
        System.Windows. Forms.DrawItemE ventArgs) Handles TabControl1.Dra wItem
        ' rectange representing the TabControl's header strip
        Dim header_rect As New Rectangle(TabCo ntrol1.ClientRe ctangle.X,
        tab_rect.Y, TabControl1.Cli entRectangle.Wi dth, tab_rect.Height )

        Dim path As New GraphicsPath()
        path.AddRectang le(header_rect)
        For i As Integer = 0 To TabControl1.Tab Count - 1
        path.AddRectang le(TabControl1. GetTabRect(i))
        Next

        e.Graphics.Fill Path(Brushes.Ye llow, path)
        End Sub

        Hope this helps.
        If you have any question, please feel free to let me know.

        Sincerely,
        Linda Liu
        Microsoft Online Community Support

        Delighting our customers is our #1 priority. We welcome your comments and
        suggestions about how we can improve the support we provide to you. Please
        feel free to let my manager know what you think of the level of service
        provided. You can send feedback directly to my manager at:
        msdnmg@microsof t.com.

        This posting is provided "AS IS" with no warranties, and confers no rights.


        Comment

        • Martin M

          #5
          Re: VB.net 2005 Tabcontrol

          Try XTabControl produced by www.springsys.com




          234FFJGepIHA.49 12@TK2MSFTNGP03 .phx.gbl...
          Hi All
          >
          Is there any way to change the colour of the Tabcontrol Tab header strip
          >
          I have found how to override the individual Tab header colours in the
          drawitem event but the rest of the Tabcontrol's Tab header is the default
          windows control colour
          >
          If the Tab headers don't fill the Tabcontrol header strip it looks tacky
          >
          Failing this can anybody recommend a 3rd party Tabcontrol with can be
          customised better
          >
          Regards
          Steve
          >

          Comment

          Working...