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#
  4. how to display/ show() form in a tab page?

how to display/ show() form in a tab page?

Scheduled Pinned Locked Moved C#
questiontutorial
13 Posts 2 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.
  • N Offline
    N Offline
    nidhelp
    wrote on last edited by
    #1

    hi, anyone noes how can i display/pop-up a form IN a tab page? instead of simply typing form2 frm = new form2(); frm.Show(); wat codes do i write to tell the program to display the form at a certain place such as in a tabpage for my app? thanks..

    C 1 Reply Last reply
    0
    • N nidhelp

      hi, anyone noes how can i display/pop-up a form IN a tab page? instead of simply typing form2 frm = new form2(); frm.Show(); wat codes do i write to tell the program to display the form at a certain place such as in a tabpage for my app? thanks..

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Why do you keep asking the same questions over and over ? Why would you want to do such a thing ? The tab page has a controls collection, adding your form to that would be the only way, but it means the form needs to be written badly, if you want the tab page to have any access to it's properties. It's a hack, I recommend against it. Just create tab pages, if that's what you want. Christian Graus - Microsoft MVP - C++

      N 1 Reply Last reply
      0
      • C Christian Graus

        Why do you keep asking the same questions over and over ? Why would you want to do such a thing ? The tab page has a controls collection, adding your form to that would be the only way, but it means the form needs to be written badly, if you want the tab page to have any access to it's properties. It's a hack, I recommend against it. Just create tab pages, if that's what you want. Christian Graus - Microsoft MVP - C++

        N Offline
        N Offline
        nidhelp
        wrote on last edited by
        #3

        Why do you keep asking the same questions over and over ? sorry, cos i was afraid nobody'll see n ans the older posts.. so i posted again.. also, i don get wat u mean sometimes cos im still tryin to grasp c# concepts.. i read articles n books but still hardly get it.. i really need hands on learning - exploring/learning c# in the process of doing this app.. i feel that i learn better n faster like this.. im v sorry that u've to tell me over n over again.. but im stressed... it's kinda rush as there a few parts to my app and i gt to make it neat n working in time.. so i really really do appreciate your effort.. i wan to let forms display in a window-like or panel-like format.. dat's y i chose to use tab page.. mayb that's not a wise choice but as long as i can get it workin n displayin the way i hope to, i wld like to move on wif my tasks already.. firstly, i wan to check wif u how to add my form to controls collection.. do i click on tab box > properties > controls collection? den frm there how do i add the form? i need some simple guidance here.. pls help me... thanks a lot..

        C 1 Reply Last reply
        0
        • N nidhelp

          Why do you keep asking the same questions over and over ? sorry, cos i was afraid nobody'll see n ans the older posts.. so i posted again.. also, i don get wat u mean sometimes cos im still tryin to grasp c# concepts.. i read articles n books but still hardly get it.. i really need hands on learning - exploring/learning c# in the process of doing this app.. i feel that i learn better n faster like this.. im v sorry that u've to tell me over n over again.. but im stressed... it's kinda rush as there a few parts to my app and i gt to make it neat n working in time.. so i really really do appreciate your effort.. i wan to let forms display in a window-like or panel-like format.. dat's y i chose to use tab page.. mayb that's not a wise choice but as long as i can get it workin n displayin the way i hope to, i wld like to move on wif my tasks already.. firstly, i wan to check wif u how to add my form to controls collection.. do i click on tab box > properties > controls collection? den frm there how do i add the form? i need some simple guidance here.. pls help me... thanks a lot..

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          nidhelp wrote: also, i don get wat u mean sometimes cos im still tryin to grasp c# concepts.. Then ask again :-) You wouldn't be the only person I keep posting back to for several days. nidhelp wrote: i read articles n books but still hardly get it.. Perhaps you need to write some console stuff before you start trying to grasp how a GUI app works ? That's sure what I did when I learned C++, and I'm sure I'm all the better for it. Bite off a piece at a time, don't try to swallow it all at once. nidhelp wrote: it's kinda rush as there a few parts to my app and i gt to make it neat n working in time.. so i really really do appreciate your effort.. It worries me how many people are asking questions that show a lack of basic knowledge, and at the same time talk about being worried for their deadlines. THere's nothing wrong with being a beginner, but why do you have a deadline ? nidhelp wrote: i wan to check wif u Dude, the deliberate bad spelling is just annoying. nidhelp wrote: firstly, i wan to check wif u how to add my form to controls collection.. That was a guess, I just tried it and it doesn't work. You CANNOT add a form to a tab page. You need to recreate the form in a tab page, you can just copy and paste in the designer to do this. The form class is useless to you if you want it to show in a tab page. Christian Graus - Microsoft MVP - C++

          N 1 Reply Last reply
          0
          • C Christian Graus

            nidhelp wrote: also, i don get wat u mean sometimes cos im still tryin to grasp c# concepts.. Then ask again :-) You wouldn't be the only person I keep posting back to for several days. nidhelp wrote: i read articles n books but still hardly get it.. Perhaps you need to write some console stuff before you start trying to grasp how a GUI app works ? That's sure what I did when I learned C++, and I'm sure I'm all the better for it. Bite off a piece at a time, don't try to swallow it all at once. nidhelp wrote: it's kinda rush as there a few parts to my app and i gt to make it neat n working in time.. so i really really do appreciate your effort.. It worries me how many people are asking questions that show a lack of basic knowledge, and at the same time talk about being worried for their deadlines. THere's nothing wrong with being a beginner, but why do you have a deadline ? nidhelp wrote: i wan to check wif u Dude, the deliberate bad spelling is just annoying. nidhelp wrote: firstly, i wan to check wif u how to add my form to controls collection.. That was a guess, I just tried it and it doesn't work. You CANNOT add a form to a tab page. You need to recreate the form in a tab page, you can just copy and paste in the designer to do this. The form class is useless to you if you want it to show in a tab page. Christian Graus - Microsoft MVP - C++

            N Offline
            N Offline
            nidhelp
            wrote on last edited by
            #5

            Then ask again You wouldn't be the only person I keep posting back to for several days. >> first, thanks for your encouragement.. just hope that u wont find me annoying for bugging u all the time.. Perhaps you need to write some console stuff before you start trying to grasp how a GUI app works ? That's sure what I did when I learned C++, and I'm sure I'm all the better for it. Bite off a piece at a time, don't try to swallow it all at once. It worries me how many people are asking questions that show a lack of basic knowledge, and at the same time talk about being worried for their deadlines. THere's nothing wrong with being a beginner, but why do you have a deadline ? >>this is my sch proj which has a deadline.. having to do dis app individually using c# n IDE which are alien to me, plus the fact that im really weak in programming really stress me up.. i know i'll learn more n better if i learn bit by bit but im kinda forced to do it the fast n easy way with the deadline -_-''.. what i need n hope now is to be able to continue working on my app just so that i can finish it in time.. if i have time i really would love learning bit by bit for that's my style =) That was a guess, I just tried it and it doesn't work. You CANNOT add a form to a tab page. You need to recreate the form in a tab page, you can just copy and paste in the designer to do this. The form class is useless to you if you want it to show in a tab page. >>does that mean it's IMPOSSIBLE to show a form in tab page with a button press that calls to show form? i want to display those popup forms in one selected part of my form.. at the selected part of my form, i will create a viewing panel/window/frame/box where forms show up in.. the layout is like what u see in your screen now: MANY WINDOWS(/forms for my case) SHOWN IN TASKBAR so that user can see what forms are opened n select what he wants to view + ONLY ONE WINDOW THAT'S OPENED/MAXIMISED to allow user neat n easy viewing.. i really dont want those forms to popup/show everywhere in my screen... help.. thanks..

            C 1 Reply Last reply
            0
            • N nidhelp

              Then ask again You wouldn't be the only person I keep posting back to for several days. >> first, thanks for your encouragement.. just hope that u wont find me annoying for bugging u all the time.. Perhaps you need to write some console stuff before you start trying to grasp how a GUI app works ? That's sure what I did when I learned C++, and I'm sure I'm all the better for it. Bite off a piece at a time, don't try to swallow it all at once. It worries me how many people are asking questions that show a lack of basic knowledge, and at the same time talk about being worried for their deadlines. THere's nothing wrong with being a beginner, but why do you have a deadline ? >>this is my sch proj which has a deadline.. having to do dis app individually using c# n IDE which are alien to me, plus the fact that im really weak in programming really stress me up.. i know i'll learn more n better if i learn bit by bit but im kinda forced to do it the fast n easy way with the deadline -_-''.. what i need n hope now is to be able to continue working on my app just so that i can finish it in time.. if i have time i really would love learning bit by bit for that's my style =) That was a guess, I just tried it and it doesn't work. You CANNOT add a form to a tab page. You need to recreate the form in a tab page, you can just copy and paste in the designer to do this. The form class is useless to you if you want it to show in a tab page. >>does that mean it's IMPOSSIBLE to show a form in tab page with a button press that calls to show form? i want to display those popup forms in one selected part of my form.. at the selected part of my form, i will create a viewing panel/window/frame/box where forms show up in.. the layout is like what u see in your screen now: MANY WINDOWS(/forms for my case) SHOWN IN TASKBAR so that user can see what forms are opened n select what he wants to view + ONLY ONE WINDOW THAT'S OPENED/MAXIMISED to allow user neat n easy viewing.. i really dont want those forms to popup/show everywhere in my screen... help.. thanks..

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              nidhelp wrote: this is my sch proj which has a deadline.. Then either you've been jerking off in class, or your teacher is an idiot to give you an assignment she has not prepared you for. nidhelp wrote: i know i'll learn more n better if i learn bit by bit but im kinda forced to do it the fast n easy way with the deadline The point is, you won't learn at all, you'll end up in online forums, using whatever code people give you, because you don't have time to understand it all. But that's not your fault, obviously, if you've been given an assignment of this size to start with. nidhelp wrote: does that mean it's IMPOSSIBLE to show a form in tab page with a button press that calls to show form? Yes. It means you need to recreate the form as a tab page, like I said a couple of days ago :-) nidhelp wrote: MANY WINDOWS(/forms for my case) SHOWN IN TASKBAR You want these forms to show in the taskbar ? They will do that, but not if they are in a tab page. nidhelp wrote: ONLY ONE WINDOW THAT'S OPENED/MAXIMISED to allow user neat n easy viewing.. If there's one window, there will be one task bar item at maximum. nidhelp wrote: i really dont want those forms to popup/show everywhere in my screen... help.. You can't have the taskbar functionality you want, if the forms are all in one window. You need to recreate these forms as pages on a tab control, if that's the way you want to go. But then you will have nothing on the taskbar, just buttons in your app, using the code I showed you the other day. Christian Graus - Microsoft MVP - C++

              N 1 Reply Last reply
              0
              • C Christian Graus

                nidhelp wrote: this is my sch proj which has a deadline.. Then either you've been jerking off in class, or your teacher is an idiot to give you an assignment she has not prepared you for. nidhelp wrote: i know i'll learn more n better if i learn bit by bit but im kinda forced to do it the fast n easy way with the deadline The point is, you won't learn at all, you'll end up in online forums, using whatever code people give you, because you don't have time to understand it all. But that's not your fault, obviously, if you've been given an assignment of this size to start with. nidhelp wrote: does that mean it's IMPOSSIBLE to show a form in tab page with a button press that calls to show form? Yes. It means you need to recreate the form as a tab page, like I said a couple of days ago :-) nidhelp wrote: MANY WINDOWS(/forms for my case) SHOWN IN TASKBAR You want these forms to show in the taskbar ? They will do that, but not if they are in a tab page. nidhelp wrote: ONLY ONE WINDOW THAT'S OPENED/MAXIMISED to allow user neat n easy viewing.. If there's one window, there will be one task bar item at maximum. nidhelp wrote: i really dont want those forms to popup/show everywhere in my screen... help.. You can't have the taskbar functionality you want, if the forms are all in one window. You need to recreate these forms as pages on a tab control, if that's the way you want to go. But then you will have nothing on the taskbar, just buttons in your app, using the code I showed you the other day. Christian Graus - Microsoft MVP - C++

                N Offline
                N Offline
                nidhelp
                wrote on last edited by
                #7

                hmmm im not sure whether u get what i want to create.. how i wish i can draw n show u.. haha.. well.... i don get it.. u said to create the form as tab page.. does that mean clicking showformbutton will display a tab page made up of the form? haha.. it's the teacher's way of training us.. by learning new language on our own... well.. i do learn thro forums... though bit by bit gives me better understanding but forums help me get on with my app quickly when im lacking of time.. that's reality.. too fast, too rush.. but no choice got to survive!! haha..

                C 1 Reply Last reply
                0
                • N nidhelp

                  hmmm im not sure whether u get what i want to create.. how i wish i can draw n show u.. haha.. well.... i don get it.. u said to create the form as tab page.. does that mean clicking showformbutton will display a tab page made up of the form? haha.. it's the teacher's way of training us.. by learning new language on our own... well.. i do learn thro forums... though bit by bit gives me better understanding but forums help me get on with my app quickly when im lacking of time.. that's reality.. too fast, too rush.. but no choice got to survive!! haha..

                  C Offline
                  C Offline
                  Christian Graus
                  wrote on last edited by
                  #8

                  nidhelp wrote: hmmm im not sure whether u get what i want to create.. I think I do, you've been telling me for days. nidhelp wrote: u said to create the form as tab page.. Yes. nidhelp wrote: does that mean clicking showformbutton will display a tab page made up of the form? Yes, it means that you use the code I gave you, and the tab pages that you have in the dialog each contain the same layout as the forms you're using now, so you create tab pages that look like the forms you need. nidhelp wrote: haha.. it's the teacher's way of training us.. by learning new language on our own... Complain to the school. Seriously. Christian Graus - Microsoft MVP - C++

                  N 1 Reply Last reply
                  0
                  • C Christian Graus

                    nidhelp wrote: hmmm im not sure whether u get what i want to create.. I think I do, you've been telling me for days. nidhelp wrote: u said to create the form as tab page.. Yes. nidhelp wrote: does that mean clicking showformbutton will display a tab page made up of the form? Yes, it means that you use the code I gave you, and the tab pages that you have in the dialog each contain the same layout as the forms you're using now, so you create tab pages that look like the forms you need. nidhelp wrote: haha.. it's the teacher's way of training us.. by learning new language on our own... Complain to the school. Seriously. Christian Graus - Microsoft MVP - C++

                    N Offline
                    N Offline
                    nidhelp
                    wrote on last edited by
                    #9

                    i saw a glimpse of hope when u helped me out.. im so thankful for u.. =) btw im trying out what u said reg the codes... hope i can get it working today.. no use complaining, that's the sch's system.. they say learn not to be spoon-feed by teachers, to be independant n resourceful, to be productive n not learn too much for we may not get to use all that we learnt.. is this the world today??? so realistic.. well i still prefer moderate amount of guiding n self-learning... haha..

                    C 1 Reply Last reply
                    0
                    • N nidhelp

                      i saw a glimpse of hope when u helped me out.. im so thankful for u.. =) btw im trying out what u said reg the codes... hope i can get it working today.. no use complaining, that's the sch's system.. they say learn not to be spoon-feed by teachers, to be independant n resourceful, to be productive n not learn too much for we may not get to use all that we learnt.. is this the world today??? so realistic.. well i still prefer moderate amount of guiding n self-learning... haha..

                      C Offline
                      C Offline
                      Christian Graus
                      wrote on last edited by
                      #10

                      Good luck - once you recreate the forms as tab pages, it's pretty straightforward. Christian Graus - Microsoft MVP - C++

                      N 1 Reply Last reply
                      0
                      • C Christian Graus

                        Good luck - once you recreate the forms as tab pages, it's pretty straightforward. Christian Graus - Microsoft MVP - C++

                        N Offline
                        N Offline
                        nidhelp
                        wrote on last edited by
                        #11

                        ok so what do i do with if (tabControl1.TabPages.Contains(tabPage1)) { tabControl1.TabPages.Remove(tabPage1); } else { tabControl1.TabPages.Add(tabPage1); } where do i add them in my program? how do i add event handlers to hook up to the buttons on the main page, and when i press a button, a tab page appears or disappears? can u tell me where do i go to in order to add event handlers as well as the steps to do it..

                        C N 2 Replies Last reply
                        0
                        • N nidhelp

                          ok so what do i do with if (tabControl1.TabPages.Contains(tabPage1)) { tabControl1.TabPages.Remove(tabPage1); } else { tabControl1.TabPages.Add(tabPage1); } where do i add them in my program? how do i add event handlers to hook up to the buttons on the main page, and when i press a button, a tab page appears or disappears? can u tell me where do i go to in order to add event handlers as well as the steps to do it..

                          C Offline
                          C Offline
                          Christian Graus
                          wrote on last edited by
                          #12

                          nidhelp wrote: where do i add them in my program? That's what the method does which is called when you press a button. For the sake of time, I'd just add a public method for each button to call that does this, and call it from your main dialog class. Christian Graus - Microsoft MVP - C++

                          1 Reply Last reply
                          0
                          • N nidhelp

                            ok so what do i do with if (tabControl1.TabPages.Contains(tabPage1)) { tabControl1.TabPages.Remove(tabPage1); } else { tabControl1.TabPages.Add(tabPage1); } where do i add them in my program? how do i add event handlers to hook up to the buttons on the main page, and when i press a button, a tab page appears or disappears? can u tell me where do i go to in order to add event handlers as well as the steps to do it..

                            N Offline
                            N Offline
                            nidhelp
                            wrote on last edited by
                            #13

                            it's ok.. i managed to do it.. but it's not the way i want it exactly.. 1)how can a user close a tab page including the tab after viewing it?? i dont mean it this way: tabControl1.TabPages.Contains(tabPage4) { tabControl1.TabPages.Remove(tabPage4); } 2)how do i disallow the user from opening the same tab page of information? i dont want to disallow the button function.. just want to disallowing opening of tab page.. thanks

                            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