Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Custom TabControl

thanks for the share, also written very clean
(Aug 8, 2014 08:04 AM)Josh‎ Wrote:  Erm... What?
[Image: e10657d15c38727d8b3af58b8879f95a.png]

Maybe make it scroll instead?

I fixed it (And changed colours/alignment) :D

[Image: 4b4dc8af77.png]

[Image: 36f2f42d24.png]
Nice, looks similar to the TabControl of Imminent Monitor.
(Aug 9, 2014 04:29 PM)Madara-Uchiha Wrote:  Nice, looks similar to the TabControl of Imminent Monitor.

Yep, because everyone is using the same design pattern.
[Image: 1zL3pDG.jpg]
(Aug 9, 2014 04:29 PM)Madara-Uchiha Wrote:  Nice, looks similar to the TabControl of Imminent Monitor.

u mean aeon tabcontrol https://hackforums.net/showthread.php?tid=2541240

anyway why u use bmp (Graphics.FromImage)

Code
Public Class Tb
    Inherits TabControl

    Sub New()
      SetStyle(ControlStyles.UserPaint Or ControlStyles.AllPaintingInWmPaint Or ControlStyles.Opaque Or ControlStyles.ResizeRedraw, True)
      'SetStyle(ControlStyles.Selectable, False)
      Dock = DockStyle.Fill
      ItemSize = New Size(120, 25)
      SizeMode = TabSizeMode.Fixed
      Alignment = TabAlignment.Left
      DrawMode = TabDrawMode.OwnerDrawFixed
    End Sub

    Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
      Dim G As Graphics = e.Graphics
      G.Clear(Color.FromArgb(71, 80, 100))
      'G.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
      For i = 0 To TabCount - 1
      Dim TabRectangle As Rectangle = GetTabRect(i)
      If i = SelectedIndex Then
      G.FillRectangle(New SolidBrush(Color.FromArgb(95, 105, 127)), TabRectangle)
      G.FillRectangle(Brushes.DeepSkyBlue, New Rectangle(TabRectangle.Location.X + 2, TabRectangle.Location.Y + 2, 3, TabRectangle.Height - 4))
      Else
      G.FillRectangle(New SolidBrush(Color.FromArgb(71, 80, 100)), TabRectangle)
      G.FillRectangle(New SolidBrush(Color.FromArgb(90, 102, 127)), New Rectangle(TabRectangle.Location.X + 2, TabRectangle.Location.Y + 2, 3, TabRectangle.Height - 4))
      End If
      G.DrawString(TabPages(i).Text, Font, Brushes.White, TabRectangle, New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
      Next
      G.Dispose()
      MyBase.OnPaint(e)
    End Sub
End Class
(Aug 10, 2014 01:17 PM)Only3 Wrote:  u mean aeon tabcontrol https://hackforums.net/showthread.php?tid=2541240

anyway why u use bmp (Graphics.FromImage)

Code
Public Class Tb
    Inherits TabControl

    Sub New()
      SetStyle(ControlStyles.UserPaint Or ControlStyles.AllPaintingInWmPaint Or ControlStyles.Opaque Or ControlStyles.ResizeRedraw, True)
      'SetStyle(ControlStyles.Selectable, False)
      Dock = DockStyle.Fill
      ItemSize = New Size(120, 25)
      SizeMode = TabSizeMode.Fixed
      Alignment = TabAlignment.Left
      DrawMode = TabDrawMode.OwnerDrawFixed
    End Sub

    Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
      Dim G As Graphics = e.Graphics
      G.Clear(Color.FromArgb(71, 80, 100))
      'G.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
      For i = 0 To TabCount - 1
      Dim TabRectangle As Rectangle = GetTabRect(i)
      If i = SelectedIndex Then
      G.FillRectangle(New SolidBrush(Color.FromArgb(95, 105, 127)), TabRectangle)
      G.FillRectangle(Brushes.DeepSkyBlue, New Rectangle(TabRectangle.Location.X + 2, TabRectangle.Location.Y + 2, 3, TabRectangle.Height - 4))
      Else
      G.FillRectangle(New SolidBrush(Color.FromArgb(71, 80, 100)), TabRectangle)
      G.FillRectangle(New SolidBrush(Color.FromArgb(90, 102, 127)), New Rectangle(TabRectangle.Location.X + 2, TabRectangle.Location.Y + 2, 3, TabRectangle.Height - 4))
      End If
      G.DrawString(TabPages(i).Text, Font, Brushes.White, TabRectangle, New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
      Next
      G.Dispose()
      MyBase.OnPaint(e)
    End Sub
End Class

No I'm pretty sure he meant Imminent Monitor.
[Image: vjPWhyy.gif]
I love the design OP. Great work. I might even make a theme based on those colours in the future.

(Aug 9, 2014 04:11 PM)Josh‎ Wrote:  I fixed it (And changed colours/alignment) :D

[Image: 4b4dc8af77.png]

[Image: 36f2f42d24.png]

Nice man. Also, another suggestion would be instead of those 2 buttons, just automatically make the tabs smaller (like in Google Chrome). That would be sexy as fuck.
(Aug 10, 2014 10:40 PM)Earn Wrote:  Nice man. Also, another suggestion would be instead of those 2 buttons, just automatically make the tabs smaller (like in Google Chrome). That would be sexy as fuck.

I can try, not very good at making this sort of thing.
(Aug 10, 2014 03:10 PM)$lick Wrote:  No I'm pretty sure he meant Imminent Monitor.

😁 u should open ur mind from time to time 😏
(Aug 11, 2014 03:52 AM)Only3 Wrote:  😁 u should open ur mind from time to time 😏

Well you corrected him on something that was correct.
[Image: vjPWhyy.gif]
(Aug 11, 2014 04:17 AM)$lick Wrote:  Well you corrected him on something that was correct.

you are right 👍 but isnt it obvious 😊 so what was my point lazy ? 😁
Nice Release Love it! Thanks for This!
(Aug 8, 2014 08:52 AM)SaketSaket Wrote:  If you need i will make vertical tab control for you... currently working on your suggestions too...

@OP nice work mate.. Keep coding... ;)

HI

i need vertical tab control i will want you to make some for me
Looks really nice, thanks for the share (: Could be useful!
[Image: New-Signature-v2.png]
(Sep 1, 2014 04:22 AM)DAVIDLEX Wrote:  HI

i need vertical tab control i will want you to make some for me

check my themes... they have vertical tab control in few of them... ;)
BTC - bc1q3efew3yzfwhdz290dafykaw0a2w56g2j69g2c6
ETH - 0xf1c873217032468990D3313da6509D1b813c4671
USDT - 0xf1c873217032468990D3313da6509D1b813c4671
PP - [email protected]


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by SIM-3933056Apr 16, 2021 02:08 PM 29 1,214 Apr 16, 2021 02:08 PM
Last Post: centan
[.NET] by sgamesOct 15, 2018 10:19 AM 5 344 Oct 15, 2018 10:19 AM
Last Post: sgames
[.NET] by edin_Jan 25, 2018 11:55 AM 4 302 Jan 25, 2018 11:55 AM
Last Post: Ninja