Results 1 to 6 of 6

Thread: Adding tabs to my tab control

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800

    Adding tabs to my tab control

    doing this doesn't work.....niether work

    SendMessage(Tab, TCM_INSERTITEM, 1, (LPARAM) "Test");
    SendMessage(Tab, TCM_SETITEM, 1, (LPARAM) "TEST");

    what is the correct way to add tabs (my control is called Tab)

  2. #2
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    Is "Tab" declared as "HWND" and is it a handle to the tab when you ceate the tab control like

    Tab = CreateWindow(...);
    Baaaaaaaaah

  3. #3
    jim mcnamara
    Guest
    Abdul is saying that the variable tab has to be

    HWND tab;

    and actually be the handle to the tab control.

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    if it's not, but rather a #define, you need to call GetDlgItem(parentHWnd, Tab); to get the hwnd.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    I've already decalred it......thats not my problem

    I have the control on my form...I was able to add some tabs, now how do I put text into the tabs

  6. #6
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    the LPARAM of both TCM_INSERTITEM and TCM_SETITEM must be a pointer to a TCITEM struct. There is a member to set the item text.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

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