Results 1 to 13 of 13

Thread: [RESOLVED] Tabstrip backcolor

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2005
    Posts
    1,834

    Resolved [RESOLVED] Tabstrip backcolor

    Hi, I'm using the Tabstrip from Common Controls 5.0 with a manifest file in order to get the XP theme.

    When I put a Frame on it, it has a different backcolor than the Tabstrip. The Tabstrip's backcolor is not solid, but gradient and it doesn't have a "BackColor" property either.



    After searching for transparent Frames and Pictureboxes, the best solution seems to be to put a borderless Picturebox on the Tabstrip.



    Then get the color from the first tab and give the Picturebox (and the controls inside) the same backcolor.



    I use GetPixel to get the color from the first tab and it works fine with a Commandbutton, but when using it in the Form_Paint or Form_Initialize event in order to do it automatically, it's too fast and gets the color behind the form (i.e. desktop background).

    Is there a solution for this?

    vb Code:
    1. Option Explicit
    2.  
    3. Private Declare Function GetPixel Lib "gdi32" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long) As Long
    4. Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
    5.  
    6. Private Sub Command1_Click()
    7.     Dim st As Long, pt As Long
    8.    
    9.     st = GetDC(TabStrip1.hwnd)
    10.     pt = GetPixel(st, 2, 5)
    11.    
    12.     Frame1.BackColor = pt
    13.     Picture1.BackColor = pt
    14. End Sub

  2. #2
    Addicted Member
    Join Date
    Jul 2007
    Posts
    146

    Re: Tabstrip backcolor

    Hello Chris,

    On my site you will find some transparent controls source code, have a look if they are useful for you.

    HTH
    Jottum™
    XpVistaControls , (transparent) usercontrols for XP, Vista and 7 with W2K legacy support.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2005
    Posts
    1,834

    Re: Tabstrip backcolor

    Thanks Jottum

  4. #4
    Fanatic Member coolcurrent4u's Avatar
    Join Date
    Apr 2008
    Location
    *****
    Posts
    993

    Question Re: [RESOLVED] Tabstrip backcolor

    How do i insert tabs in your control?

  5. #5
    Fanatic Member coolcurrent4u's Avatar
    Join Date
    Apr 2008
    Location
    *****
    Posts
    993

    Re: Tabstrip backcolor

    Quote Originally Posted by Jottum View Post
    Hello Chris,

    On my site you will find some transparent controls source code, have a look if they are useful for you.

    HTH
    Hello thanks for all the control you are great.

    But it seems i cannot use onle vbframe and vbtabstrip control with you code or can i. i have tried so many time it either complain of one error or the other when i try to put it im my code.

    Can you do me a favour. pls do a project with xpstyle one tabstrip and a frame on it only

    or is it only with your frame that i get the transparency.

    Am using vbtabstrip and vbframe

    Thanks once again

  6. #6
    Addicted Member
    Join Date
    Aug 2008
    Posts
    136

    Re: [RESOLVED] Tabstrip backcolor

    Hi,

    is there a way to make Chris' method work properly, i mean without command button?
    i really like that method..

    thank you

  7. #7
    Fanatic Member coolcurrent4u's Avatar
    Join Date
    Apr 2008
    Location
    *****
    Posts
    993

    Re: [RESOLVED] Tabstrip backcolor

    this control may be helpful Here
    Programming is all about good logic. Spend more time here


    (Generate pronounceable password) (Generate random number c#) (Filter array with another array)

  8. #8
    Addicted Member
    Join Date
    Aug 2008
    Posts
    136

    Re: [RESOLVED] Tabstrip backcolor

    yes i saw it once but it's not help me..
    i need to use Form_Resize to resize tabstrip and frame, but the fame cannot be resized..
    or have you succeed to make it resized?

    thank you anyway, i'll post my question in that thread..

  9. #9
    Fanatic Member coolcurrent4u's Avatar
    Join Date
    Apr 2008
    Location
    *****
    Posts
    993

    Re: [RESOLVED] Tabstrip backcolor

    i have been using that control, though i have never resized in runtime.

    i don't think da should be a problem. download that latest version and try it again
    Programming is all about good logic. Spend more time here


    (Generate pronounceable password) (Generate random number c#) (Filter array with another array)

  10. #10
    New Member
    Join Date
    Apr 2004
    Posts
    11

    Re: [RESOLVED] Tabstrip backcolor

    Didn't work with me with controls v.5 or v.6 either !!!
    at all !!!!
    what's wrong !!?

  11. #11
    Fanatic Member coolcurrent4u's Avatar
    Join Date
    Apr 2008
    Location
    *****
    Posts
    993

    Re: [RESOLVED] Tabstrip backcolor

    what exactly are you trying to do?

    do you have vb6sp6 or vs6sp6 installed?

    can you post a sample project
    Programming is all about good logic. Spend more time here


    (Generate pronounceable password) (Generate random number c#) (Filter array with another array)

  12. #12
    New Member
    Join Date
    Apr 2004
    Posts
    11

    Re: [RESOLVED] Tabstrip backcolor

    i'm just tried the code of "Chris001"
    but it didn't work ...

    i'm using vb6 pro . sp6 !

  13. #13
    Fanatic Member coolcurrent4u's Avatar
    Join Date
    Apr 2008
    Location
    *****
    Posts
    993

    Re: [RESOLVED] Tabstrip backcolor

    please post a sample project
    Programming is all about good logic. Spend more time here


    (Generate pronounceable password) (Generate random number c#) (Filter array with another array)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width