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. TabControl Problem in FromView

TabControl Problem in FromView

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++data-structures
6 Posts 3 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.
  • M Offline
    M Offline
    mohit 12
    wrote on last edited by
    #1

    Hey guys. I have one MFC Class with Form with lots of buttons and radiobuttons,Edit Control they are basically Functions for Calculator Now I Used OnDraw() to plot graphs in Formview. There are like 9 Graphs and I want to get each Graph in tabs.Afterwards i realized that TabControl Only support CDialog. So I have to create 9 Diffrent Class for each Tabs and then draw all graphs again there. I found out OnDraw() doesnt get called in DialogBox i wrote OnPaint and pointed that function to OnDraw() but now OnPaint() is not getting called by itself. I Googled everything about OnPaint() and read almost all Forums about it but still couldn't solve it. So basically I am not able to Draw anything in Dialogs(tabs). I cannot call any methods of formview from my dialog box because the values formview contains cannot be access by cdialog class since formview is not initialized when you call CDialog Functions so i get access violation errors. If any one understand this problems or have any opinion Please Reply.. I will post some error codes and pseudo code for my programs.. Thank you..

    T 2 Replies Last reply
    0
    • M mohit 12

      Hey guys. I have one MFC Class with Form with lots of buttons and radiobuttons,Edit Control they are basically Functions for Calculator Now I Used OnDraw() to plot graphs in Formview. There are like 9 Graphs and I want to get each Graph in tabs.Afterwards i realized that TabControl Only support CDialog. So I have to create 9 Diffrent Class for each Tabs and then draw all graphs again there. I found out OnDraw() doesnt get called in DialogBox i wrote OnPaint and pointed that function to OnDraw() but now OnPaint() is not getting called by itself. I Googled everything about OnPaint() and read almost all Forums about it but still couldn't solve it. So basically I am not able to Draw anything in Dialogs(tabs). I cannot call any methods of formview from my dialog box because the values formview contains cannot be access by cdialog class since formview is not initialized when you call CDialog Functions so i get access violation errors. If any one understand this problems or have any opinion Please Reply.. I will post some error codes and pseudo code for my programs.. Thank you..

      T Offline
      T Offline
      tanu misra
      wrote on last edited by
      #2

      hi.. As per my knowledge OnPaint() is called when ever any dialog is resized, minimised or maximized. Only thing which i have understood is that u r trying to make a calculator.. Hoping that Im Right.. :) All the Best..

      M 1 Reply Last reply
      0
      • M mohit 12

        Hey guys. I have one MFC Class with Form with lots of buttons and radiobuttons,Edit Control they are basically Functions for Calculator Now I Used OnDraw() to plot graphs in Formview. There are like 9 Graphs and I want to get each Graph in tabs.Afterwards i realized that TabControl Only support CDialog. So I have to create 9 Diffrent Class for each Tabs and then draw all graphs again there. I found out OnDraw() doesnt get called in DialogBox i wrote OnPaint and pointed that function to OnDraw() but now OnPaint() is not getting called by itself. I Googled everything about OnPaint() and read almost all Forums about it but still couldn't solve it. So basically I am not able to Draw anything in Dialogs(tabs). I cannot call any methods of formview from my dialog box because the values formview contains cannot be access by cdialog class since formview is not initialized when you call CDialog Functions so i get access violation errors. If any one understand this problems or have any opinion Please Reply.. I will post some error codes and pseudo code for my programs.. Thank you..

        T Offline
        T Offline
        tanu misra
        wrote on last edited by
        #3

        hi If u r making a calculator, u cn tk help of Visual C++ Programming By Mr.Yashwant Kanetkar Page no.434.there he has given sum hints on this topic.. :) Hope U solve your Problem soon.. All the Best tc..

        I 1 Reply Last reply
        0
        • T tanu misra

          hi If u r making a calculator, u cn tk help of Visual C++ Programming By Mr.Yashwant Kanetkar Page no.434.there he has given sum hints on this topic.. :) Hope U solve your Problem soon.. All the Best tc..

          I Offline
          I Offline
          Iain Clarke Warrior Programmer
          wrote on last edited by
          #4

          tanu misra wrote:

          u cn tk

          Is your kbd broken? You seem to be missing some vowels. Iain.

          I am one of "those foreigners coming over here and stealing our jobs". Yay me!

          M 1 Reply Last reply
          0
          • I Iain Clarke Warrior Programmer

            tanu misra wrote:

            u cn tk

            Is your kbd broken? You seem to be missing some vowels. Iain.

            I am one of "those foreigners coming over here and stealing our jobs". Yay me!

            M Offline
            M Offline
            mohit 12
            wrote on last edited by
            #5

            thank you all for reply. I solved the problem, Calling ON_WM_PAINT() in your TabControl Class will call OnPaint. But when i switch tabs it suppose to Call OnPaint each time so it redraw the graph. I called INVALIDATE() but doesn't seem like working since TabControl is not mainwindow. INVALIDATE only refresh the main window not the tabcontrol :( ..

            1 Reply Last reply
            0
            • T tanu misra

              hi.. As per my knowledge OnPaint() is called when ever any dialog is resized, minimised or maximized. Only thing which i have understood is that u r trying to make a calculator.. Hoping that Im Right.. :) All the Best..

              M Offline
              M Offline
              mohit 12
              wrote on last edited by
              #6

              When i call invalidate() it just refresh the mytabcontrol and it blinks but it doesnt actully redraw the graph with new values. this is like scientific calculator with function on top inside formview and graphs on tabview(dialog mode). so each time i switch tab or change values in calculator it has to redraw graph depending upon the new values in calculator. if anyone have got idea how to do this or any hint. PLEASE... <<<>> THANKzzzzz

              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