Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6141105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:12:15+00:00 2026-05-23T18:12:15+00:00

I was using System.Windows.Forms.TabControl to list custom pages, but there seems be a Hardcoded

  • 0

I was using System.Windows.Forms.TabControl to list custom pages, but there seems be a Hardcoded Padding of 3 pixels on all sides of Tabcontrol.

How I can remove that. One point here is I dont want to remove Tabs on Top

http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/a8c5bc93-8f76-42e7-b501-b12f8b5bd1eb/

I found above MSDN link whick does removes margins from all sides including TabItems on top which I dont want.

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T18:12:15+00:00Added an answer on May 23, 2026 at 6:12 pm

    This is the only way I can modify that padding.

    Imports System.Runtime.InteropServices
    
    Public Class NativeTabControl
        Inherits NativeWindow
        Private Const TCM_FIRST As Int32 = &H1300
        Private Const TCM_ADJUSTRECT As UInt32 = (TCM_FIRST + 40)
    Private baseCtrl As TabControl
    
    Public Sub New(ByVal ctrl As TabControl)
        Me.baseCtrl = ctrl
        AddHandler ctrl.HandleDestroyed, AddressOf OnHandleDestroyed
        Me.AssignHandle(ctrl.Handle)
    End Sub
    
    Private Sub OnHandleDestroyed(ByVal sender As Object, ByVal e As EventArgs)
        ' Window was destroyed, release hook.
        RemoveHandler baseCtrl.HandleDestroyed, AddressOf OnHandleDestroyed
        Me.ReleaseHandle()
    End Sub
    
    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 += 1
            rc.Top -= 1
            rc.Bottom += 1
            Marshal.StructureToPtr(rc, m.LParam, True)
        End If
        MyBase.WndProc(m)
    End Sub
    
    Private Structure RECT
        Public Left, Top, Right, Bottom As Int32
    End Structure
    End Class
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can already do: using System.Windows.Forms; Button b; or: System.Windows.Forms.Button b; but I would
I am using System.Windows.Forms.RichTextBox and doing something like RichTextBox1.Text = Hello World; But after
I am using System.Windows; and System.Windows.Controls; so I can't use System.Windows.Forms; because there is
I tried using http://msdn.microsoft.com/en-us/library/system.windows.forms.application.threadexception.aspx#Y399 but when I do this throw new ArgumentNullException(playlist is empty);
Is there anything wrong in my code? using System; using System.Windows.Forms; public class MyProgram
I'm currently using the charting within .NET using System.Windows.Forms.DataVisualization.Charting.Chart . Thus far it seems
using System; using System.Drawing; using System.IO; using System.Security.Cryptography; using System.Text.RegularExpressions; using System.Windows.Forms; using System.Threading;
using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Drawing.Imaging;
The winform: The code: using System; using System.Windows.Forms; namespace DemoApp { public partial class
Is it possible to embed a Gtk widget into an application using System.Windows.Forms? Thanks!

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.