Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Tab Control and GroupBox...Anybody?

Tab Control and GroupBox...Anybody?

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
16 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D damir_tk

    Please, is there anybody who can show me how can I put a group box control over the tab control, and to have a caption of the group box to be transparent, not gray. I don't use MFC, I use ATL so I am working with the SendDlgItemMessage, but it doesn't matter, as everything boils down to messages anyways. I use manifest files, so controls are XP-like. Thank you.

    M Offline
    M Offline
    Mark Salsbery
    wrote on last edited by
    #3

    You cold resize/reposition the tab control to fit in the group box. Making the groupbox text transparent is tough. Ownerdraw may help but it seems easier to just draw a frame and the text. I don't use ATL, I use MFC so I can't provide an example. Mark

    D 1 Reply Last reply
    0
    • L led mike

      A group box control without a caption. Isn't that just a rectangle? And what does "over the tab control" mean? On Top (Z order)? Please don't make up new technical terms, there are enough already.

      led mike

      D Offline
      D Offline
      damir_tk
      wrote on last edited by
      #4

      No, it is not that. A group box has a caption, but I don't want a gray background for it.

      L 1 Reply Last reply
      0
      • M Mark Salsbery

        You cold resize/reposition the tab control to fit in the group box. Making the groupbox text transparent is tough. Ownerdraw may help but it seems easier to just draw a frame and the text. I don't use ATL, I use MFC so I can't provide an example. Mark

        D Offline
        D Offline
        damir_tk
        wrote on last edited by
        #5

        Yeah....this is why more and more businesses are dumping Visual C++...this is something that C# or VB programmers are not even thinking about, they just put it on the window and concentrate on the more important business logic.

        M S 2 Replies Last reply
        0
        • L led mike

          A group box control without a caption. Isn't that just a rectangle? And what does "over the tab control" mean? On Top (Z order)? Please don't make up new technical terms, there are enough already.

          led mike

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #6

          Remember, led mike, you can give a man a gift certificate for a filet-o-fish and he'll eat for a day. Get a man a job at McDonalds and he'll have an employee discount for life. I think that's how the saying goes...

          L 1 Reply Last reply
          0
          • D damir_tk

            Yeah....this is why more and more businesses are dumping Visual C++...this is something that C# or VB programmers are not even thinking about, they just put it on the window and concentrate on the more important business logic.

            M Offline
            M Offline
            Mark Salsbery
            wrote on last edited by
            #7

            Yeah, I can only dream of using those fancy new Windows controls they have in C# and VB.

            1 Reply Last reply
            0
            • D damir_tk

              Please, is there anybody who can show me how can I put a group box control over the tab control, and to have a caption of the group box to be transparent, not gray. I don't use MFC, I use ATL so I am working with the SendDlgItemMessage, but it doesn't matter, as everything boils down to messages anyways. I use manifest files, so controls are XP-like. Thank you.

              M Offline
              M Offline
              Michael Dunn
              wrote on last edited by
              #8

              Set the Transparent style bit on the group box (WS_EX_TRANSPARENT).

              --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

              M D 2 Replies Last reply
              0
              • M Mark Salsbery

                Remember, led mike, you can give a man a gift certificate for a filet-o-fish and he'll eat for a day. Get a man a job at McDonalds and he'll have an employee discount for life. I think that's how the saying goes...

                L Offline
                L Offline
                led mike
                wrote on last edited by
                #9

                :laugh::laugh:

                led mike

                1 Reply Last reply
                0
                • D damir_tk

                  No, it is not that. A group box has a caption, but I don't want a gray background for it.

                  L Offline
                  L Offline
                  led mike
                  wrote on last edited by
                  #10

                  So you are saying if you put a group box in a standard white window the caption has a gray background? That's nasty. I see Michael Dunn has given you the answer. Give him a 5 for that.

                  led mike

                  1 Reply Last reply
                  0
                  • M Michael Dunn

                    Set the Transparent style bit on the group box (WS_EX_TRANSPARENT).

                    --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

                    M Offline
                    M Offline
                    Mark Salsbery
                    wrote on last edited by
                    #11

                    If only they had implemented it in the text part of the control. What's interesting is the part inside the box is transparent with or without that style set :wtf:

                    M 1 Reply Last reply
                    0
                    • M Michael Dunn

                      Set the Transparent style bit on the group box (WS_EX_TRANSPARENT).

                      --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

                      D Offline
                      D Offline
                      damir_tk
                      wrote on last edited by
                      #12

                      Thanks for your help, Mike, but it doesn't work. Simply selecting a Transparent property from the property control ( I use Visual Studio .Net 2005, but the application is Visual C++ with ATL 8 ) would add a WS_EX_TRANSPARENT bit to the group box (I checked the .rc file and it is like that). However, even though the group box does draw transparently, the caption bar of the group box still has an ugly gray background behind the black color text. I just don't know how to get rid of it.

                      1 Reply Last reply
                      0
                      • D damir_tk

                        Yeah....this is why more and more businesses are dumping Visual C++...this is something that C# or VB programmers are not even thinking about, they just put it on the window and concentrate on the more important business logic.

                        S Offline
                        S Offline
                        Sam Hobbs
                        wrote on last edited by
                        #13

                        Yeah non-software companies usually use VB for their internal programming and software companies usually do not use VB for their products. Microsoft could have provided for VC the conveniences they provided for VB but they just did not. Many things are easier in VB but when we need to do things that VB is not designed to do then VB is more difficult.

                        M 1 Reply Last reply
                        0
                        • M Mark Salsbery

                          If only they had implemented it in the text part of the control. What's interesting is the part inside the box is transparent with or without that style set :wtf:

                          M Offline
                          M Offline
                          Michael Dunn
                          wrote on last edited by
                          #14

                          Yeah, the group box has weird behavior when themes are on in XP (maybe Vista too? not sure about that)

                          --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

                          M 1 Reply Last reply
                          0
                          • S Sam Hobbs

                            Yeah non-software companies usually use VB for their internal programming and software companies usually do not use VB for their products. Microsoft could have provided for VC the conveniences they provided for VB but they just did not. Many things are easier in VB but when we need to do things that VB is not designed to do then VB is more difficult.

                            M Offline
                            M Offline
                            mirano
                            wrote on last edited by
                            #15

                            That is fine, but we could just have at least the basic functionality, not to bother with the transparency of static controls, for goodness sake.

                            Sarajevo, Bosnia

                            1 Reply Last reply
                            0
                            • M Michael Dunn

                              Yeah, the group box has weird behavior when themes are on in XP (maybe Vista too? not sure about that)

                              --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

                              M Offline
                              M Offline
                              mirano
                              wrote on last edited by
                              #16

                              I truly believe that with Vista we'll encounter a whole new set of problems with even the most common controls.

                              Sarajevo, Bosnia

                              1 Reply Last reply
                              0
                              Reply
                              • Reply as topic
                              Log in to reply
                              • Oldest to Newest
                              • Newest to Oldest
                              • Most Votes


                              • Login

                              • Don't have an account? Register

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • World
                              • Users
                              • Groups