Imports System.Runtime.InteropServices
Imports System.Windows.Forms
Public Class Form1
Public Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
Me.NativeTabControl1 = New NativeTabControl
Me.NativeTabControl1.AssignHandle(Me.TabControl1.Handle)
End Sub
Private NativeTabControl1 As NativeTabControl
Private Class NativeTabControl
Inherits NativeWindow
Protected Overrides Sub WndProc(ByRef m As Message)
If (m.Msg = TCM_ADJUSTRECT) Then
Dim rc As RECT = DirectCast(m.GetLParam(GetType(RECT)), RECT)
'Adjust these values to suit, dependant upon Appearance
rc.Left -= 3
rc.Right += 3
rc.Top -= 3
rc.Bottom += 3
Marshal.StructureToPtr(rc, m.LParam, True)
End If
MyBase.WndProc(m)
End Sub
Private Const TCM_FIRST As Int32 = &H1300
Private Const TCM_ADJUSTRECT As Int32 = (TCM_FIRST + 40)
Private Structure RECT
Public Left, Top, Right, Bottom As Int32
End Structure
End Class
End Class
暂时没有评论