Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Visual Basic Programming › Visual Basics Tab control color help.

Visual Basics Tab control color help.

Posts 1–4 of 4 · Page 1 of 1
-J
-Jerry™
Visual Basics Tab control color help.
I am new to VB and trying to make my first GUI. Though the Tab control is annoying me, as the default background is grey. I read around and it is not possible to change without using a code.

Code:
Private Sub TabControl1_DrawItem(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles TabControl1.DrawItem

    'Firstly we'll define some parameters.
    Dim CurrentTab As TabPage = TabControl1.TabPages(e.Index)
    Dim ItemRect As Rectangle = TabControl1.GetTabRect(e.Index)
    Dim FillBrush As New SolidBrush(Color.Red)
    Dim TextBrush As New SolidBrush(Color.White)
    Dim sf As New StringFormat
    sf.Alignment = StringAlignment.Center
    sf.LineAlignment = StringAlignment.Center

    'If we are currently painting the Selected TabItem we'll 
    'change the brush colors and inflate the rectangle.
    If CBool(e.State And DrawItemState.Selected) Then
        FillBrush.Color = Color.White
        TextBrush.Color = Color.Red
        ItemRect.Inflate(2, 2)
    End If

    'Set up rotation for left and right aligned tabs
    If TabControl1.Alignment = TabAlignment.Left Or TabControl1.Alignment = TabAlignment.Right Then
        Dim RotateAngle As Single = 90
        If TabControl1.Alignment = TabAlignment.Left Then RotateAngle = 270
        Dim cp As New PointF(ItemRect.Left + (ItemRect.Width \ 2), ItemRect.Top + (ItemRect.Height \ 2))
        e.Graphics.TranslateTransform(cp.X, cp.Y)
        e.Graphics.RotateTransform(RotateAngle)
        ItemRect = New Rectangle(-(ItemRect.Height \ 2), -(ItemRect.Width \ 2), ItemRect.Height, ItemRect.Width)
    End If

    'Next we'll paint the TabItem with our Fill Brush
    e.Graphics.FillRectangle(FillBrush, ItemRect)

    'Now draw the text.
    e.Graphics.DrawString(CurrentTab.Text, e.Font, TextBrush, RectangleF.op_Implicit(ItemRect), sf)

    'Reset any Graphics rotation
    e.Graphics.ResetTransform()

    'Finally, we should Dispose of our brushes.
    FillBrush.Dispose()
    TextBrush.Dispose()

End Sub
I found this code (Credits to Mike Doherty)
This code is what i need, but it hides the images i have. He says on his website, "I'll leave you the challenge of modifying the code to show an image. "

Because, right now this code changes the default grey background to whatever colour you want, but at the sametime hides the Images.

Does anyone know how to show the images and change the background colour?

Thanks in advance.

- Image of Before

- With Mike's code
#1 · edited 16y ago · 16y ago
Samueldo
Samueldo
I asked this too and no one replied

I see you got your source from the same site I did.

I'm not sure about the images, try Googling something like "vb.net ownerdrawfixed show image on tabs".
#2 · 16y ago
-J
-Jerry™
Quote Originally Posted by Samueldo View Post
I asked this too and no one replied

I see you got your source from the same site I did.

I'm not sure about the images, try Googling something like "vb.net ownerdrawfixed show image on tabs".
Mate i think i found it

Painting Your Own Tabs - Second Edition - CodeProject

Trying out now.

Edit: still doesn't work but does anyone know how to use the above?
#3 · edited 16y ago · 16y ago
Hassan
Hassan
Quote Originally Posted by -Jerry™ View Post
Mate i think i found it

Painting Your Own Tabs - Second Edition - CodeProject

Trying out now.

Edit: still doesn't work but does anyone know how to use the above?
Code Project source will work !! Try it carefully !!
#4 · 16y ago
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

  • Visual Basic 2008 SendKeys.Send() HelpBy User1 in Visual Basic Programming
    1Last post 17y ago
  • Visual Basic 2010 Codes to help youBy Snoopys in CrossFire Hack Coding / Programming / Source Code
    8Last post 15y ago
  • Help me to a hack or injector visual basic c++By deniz617 in CrossFire Help
    1Last post 15y ago
  • visual basics help or vb6By josephjboogie3 in Visual Basic Programming
    2Last post 18y ago
  • [Help] Atom API with Visual Basic 6.0 or .NETBy Bull3t in Visual Basic Programming
    5Last post 20y ago

Tags for this Thread

None