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!

Change backcolor of tabs and frames

Status
Not open for further replies.

Kazalivich

Programmer
Jun 23, 2000
9
PE
How can i change the back color of tabs and frames, please
 
Well, I guess you could try it with graphic api functions.
For example:

*** in declarations ***

Private Declare Function GetDC Lib "user32.dll" (ByVal hWnd As Long) As Long

Private Declare Function ReleaseDC Lib "user32.dll" (ByVal hWnd As Long, ByVal hdc As Long) As Long

Private Declare Function StretchBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long

Private Const SRCCOPY = &HCC0020


*** in some function ***

Private Sub PaintTheTab()

Dim lngDC As Long
Dim RetVal As Long

lngDC = GetDC(Me.TabStrip1.hWnd)

RetVal = StretchBlt(lngDC, 0, 0, 100, 100, Picture1.hdc, 0, 0, 100, 100, SRCCOPY)

RetVal = ReleaseDC(Me.TabStrip1.hWnd, lngDC)

End Sub

... and add a picturebox ('Picture1' in this example).

I didn't try this out, but it might work. And if you just want it one color instead of an image, just use a one-color image.

Good Luck, Remedy...
 
By the way, frames have a property 'BackColor' you can use.

Remedy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top