Results 1 to 4 of 4

Thread: Queston for any experienced control progger

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2001
    Location
    Washington, DC
    Posts
    422

    Queston for any experienced control progger

    It looks like I am going to have to write my own tab control, because we can't find features on currently existing tab controls on the market to meet our needs.

    I need to be able to control borders (etched, flat, 3D, etc) around the entire tab area, colors (selected tab, unselected tabs, background color behind the actual tab strip, and color of the tab area), and include a toolbar inside each tabs area. The best example I have found that meets this requirement are the tabs in Test Director (I have attached links to screen shots).

    I have two questions:

    1) Does anyone know of a tab control that meets these requirements

    and more importantly . . .

    2) Where is a good place to start (books, web sites, source code, other references) to begin to code such a project

    Thanks.

    FLL


    Screen shot 1 - tab look:
    http://www.hisoftware.com/MercuryInteractive/tdsc5.htm

    Screen shot 2 - toolbar on tab:
    http://www.hisoftware.com/MercuryInt...tdscviewer.htm

  2. #2
    Lively Member Tygur's Avatar
    Join Date
    Jul 2002
    Posts
    108
    If it helps any, you can put a toolbar control in a picturebox, and then have that picturebox show when the user clicks a particular tab. This may increase your chances of finding an appropriate tab control, or at least make things a little easier when you start making one.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2001
    Location
    Washington, DC
    Posts
    422
    While that option would serve some of the functionality of the control, the requirements (which I won't list here b/c they are long) ask for a control that is lightweight (probably not using picture boxes or the existing SStab control) and allow for a choice in tab display (rounded edges, box edges, etc). This looks like it will require a third party control. I have not been able to find one, which means I will be creating the control from the ground up. If no one knows of a third party control that meets these requirements, I'd appreciate some direction on where to start on this one.

    Thanks

    FLL

  4. #4
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148
    The windows class anme for the tab common control is "SysTabControl32" which you need to pass as the szClass parameter to the CreateWindowEx API call to create a new TAB window.

    The tab control has the following sytle modifiers:-
    VB Code:
    1. Public Enum TabControlStyleFlags
    2.      TCS_SCROLLOPPOSITE      = &H0001  
    3.      TCS_BOTTOM              = &H0002
    4.      TCS_RIGHT               = &H0002
    5.      TCS_MULTISELECT         = &H0004  
    6.      TCS_FLATBUTTONS         = &H0008
    7.      TCS_FORCEICONLEFT       = &H0010
    8.      TCS_FORCELABELLEFT      = &H0020
    9.      TCS_HOTTRACK            = &H0040
    10.      TCS_VERTICAL            = &H0080
    11.      TCS_TABS                = &H0000
    12.      TCS_BUTTONS             = &H0100
    13.      TCS_SINGLELINE          = &H0
    14.      TCS_MULTILINE           = &H0200
    15.      TCS_RIGHTJUSTIFY        = &H0000
    16.      TCS_FIXEDWIDTH          = &H0400
    17.      TCS_RAGGEDRIGHT         = &H0800
    18.      TCS_FOCUSONBUTTONDOWN   = &H1000
    19.      TCS_OWNERDRAWFIXED      = &H2000
    20.      TCS_TOOLTIPS            = &H4000
    21.      TCS_FOCUSNEVER          = &H8000
    22. End Enum

    If you can't get the style you want from these then you need to specify TCS_OWNERDRAWFIXED and subclass the window that is created. Then when you get the message WM_DRAWITEM you need to draw the tab as you would like it.

    Hope this helps,
    Duncan

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