Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to remove padding from a tab control?

Status
Not open for further replies.

FancyPrairie

Programmer
Oct 16, 2001
2,917
US
I have a transparent tab control containing several controls. It appears that the tab control has a padding (or margin) set so to 75. I would like to set it to 0. How do I do that?
 
I do not think you can. But how are you using it, so that the border matters? Maybe there is another workaround besides trying to change the pad.
 
I am guessing here. But if you are trying to color the tab pages with a colored label behind the page, this will take a label located anywhere on the form and size it perfect behind the tab control.

Code:
Private Sub Form_Load()
  Dim i As Integer
  Dim lblWidth As Long
  Dim tempLeft As Long
  
  'Need a lblHilite on the form somewhere
  Me.tbCtrl1.Style = 0
  Me.tbCtrl1.BackStyle = 0
  
  'Format lblhilite
  With Me.lblHilite
    .Width = Me.tbCtrl1.Width
    .Height = Me.tbCtrl1.Height
    .Top = Me.tbCtrl1.Top + 15
    .Left = Me.tbCtrl1.Left
    .Caption = ""
    .BackColor = vbRed
  End With
  End Sub
when the page changes just change the color of the label.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top