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. ATL / WTL / STL
  4. How to give data dynamically in a dialog box using visual c++

How to give data dynamically in a dialog box using visual c++

Scheduled Pinned Locked Moved ATL / WTL / STL
c++tutorialquestion
9 Posts 3 Posters 20 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.
  • L Offline
    L Offline
    lolici
    wrote on last edited by
    #1

    Hi all, How can I give data in a dialog box dynamically? In a previous project I used edit boxes (e.g for 3 conductors) and gave those data separately for each conductor but now I have to give them dynamically and I don't have standard number of conductors and I can't use edit box again. Could you please give me an idea or a good link describing step by step how to create a table in a dialog box dynamically? Thanks for your time!!

    L 1 Reply Last reply
    0
    • L lolici

      Hi all, How can I give data in a dialog box dynamically? In a previous project I used edit boxes (e.g for 3 conductors) and gave those data separately for each conductor but now I have to give them dynamically and I don't have standard number of conductors and I can't use edit box again. Could you please give me an idea or a good link describing step by step how to create a table in a dialog box dynamically? Thanks for your time!!

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Use a List Box (Windows)[^].

      L 1 Reply Last reply
      0
      • L Lost User

        Use a List Box (Windows)[^].

        L Offline
        L Offline
        lolici
        wrote on last edited by
        #3

        Thanks for your answer! :) Actually a want to edit the data. I think list box is for displaying data.. :/

        L 1 Reply Last reply
        0
        • L lolici

          Thanks for your answer! :) Actually a want to edit the data. I think list box is for displaying data.. :/

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          lolici wrote:

          Actually a want to edit the data.

          Pity you did not make that clear in your question. So what exactly are you trying to achieve with this dialog? Please edit your question and add some proper detail, if possible with some code showing where the problem is.

          L 1 Reply Last reply
          0
          • L Lost User

            lolici wrote:

            Actually a want to edit the data.

            Pity you did not make that clear in your question. So what exactly are you trying to achieve with this dialog? Please edit your question and add some proper detail, if possible with some code showing where the problem is.

            L Offline
            L Offline
            lolici
            wrote on last edited by
            #5

            I have created a dialog box in which I insert data about conductors (resistivity, permeability, diameter etc (electric power systems :) )) in edit boxes but I have done it only for 3 conductors. I have to insert-edit the number of conductors and then edit their characteristics. But I can't use again edit boxes because this is static. I want something like a dynamic table which will have rows=number of conductors and columns about is characteristic (resistivity, permeability, diameter)and edit them in dialog box. I don't know how to upload my executable to male clear what I have done but here is a part of my code for the static case of three conductors :) I want another dynamic way to edit data :/

            void CInputView::OnLinefeaturesFeatures()
            {
            // TODO: Add your command handler code here
            CInputDoc* pDoc = GetDocument();
            CFeaturesDialog DialogWindow;
            DialogWindow.m_DialogCon = m_NumCond;
            DialogWindow.m_DialogLayers = m_Layers;
            DialogWindow.m_DialogPermeability = m_AirPermeability;
            DialogWindow.m_DialogAirConductivity = m_AirConductivity;
            DialogWindow.m_DialogAirPermittivity = m_AirPermittivity;
            DialogWindow.m_DialogEarthPermeability1 = m_EarthPermeability1;
            DialogWindow.m_DialogEarthConductivity1 = m_EarthConductivity1;
            DialogWindow.m_DialogEarthPermittivity1 = m_EarthPermittivity;
            DialogWindow.m_DialogDepth = m_depth;
            DialogWindow.m_DialogEarthPermeability2 = m_EarthPermeability2;
            DialogWindow.m_DialogEarthConductivity2 = m_EarthConductivity2;
            DialogWindow.m_DialogEarthPermittivity2 = m_EarthPermittivity2;
            DialogWindow.m_Dialogfrequency = m_frequency;
            if (DialogWindow.DoModal() == IDOK)
            {
            m_NumCond = DialogWindow.m_DialogCon;
            m_Layers = DialogWindow.m_DialogLayers;
            m_AirPermeability = DialogWindow.m_DialogPermeability;
            m_AirConductivity = DialogWindow.m_DialogAirConductivity;
            m_AirPermittivity = DialogWindow.m_DialogAirPermittivity;
            m_EarthPermeability1 = DialogWindow.m_DialogEarthPermeability1;
            m_EarthConductivity1 = DialogWindow.m_DialogEarthConductivity1;
            m_EarthPermittivity = DialogWindow.m_DialogEarthPermittivity1;
            m_depth = DialogWindow.m_DialogDepth;
            m_EarthPermeability2 = DialogWindow.m_DialogEarthPermeability2;
            m_EarthConductivity2 = DialogWindow.m_DialogEarthConductivity2;
            m_EarthPermittivity2 = DialogWindow.m_DialogEarthPermittivity2;
            m_frequency = DialogWindow.m_Dialogfrequency;
            }

            }

            L 1 Reply Last reply
            0
            • L lolici

              I have created a dialog box in which I insert data about conductors (resistivity, permeability, diameter etc (electric power systems :) )) in edit boxes but I have done it only for 3 conductors. I have to insert-edit the number of conductors and then edit their characteristics. But I can't use again edit boxes because this is static. I want something like a dynamic table which will have rows=number of conductors and columns about is characteristic (resistivity, permeability, diameter)and edit them in dialog box. I don't know how to upload my executable to male clear what I have done but here is a part of my code for the static case of three conductors :) I want another dynamic way to edit data :/

              void CInputView::OnLinefeaturesFeatures()
              {
              // TODO: Add your command handler code here
              CInputDoc* pDoc = GetDocument();
              CFeaturesDialog DialogWindow;
              DialogWindow.m_DialogCon = m_NumCond;
              DialogWindow.m_DialogLayers = m_Layers;
              DialogWindow.m_DialogPermeability = m_AirPermeability;
              DialogWindow.m_DialogAirConductivity = m_AirConductivity;
              DialogWindow.m_DialogAirPermittivity = m_AirPermittivity;
              DialogWindow.m_DialogEarthPermeability1 = m_EarthPermeability1;
              DialogWindow.m_DialogEarthConductivity1 = m_EarthConductivity1;
              DialogWindow.m_DialogEarthPermittivity1 = m_EarthPermittivity;
              DialogWindow.m_DialogDepth = m_depth;
              DialogWindow.m_DialogEarthPermeability2 = m_EarthPermeability2;
              DialogWindow.m_DialogEarthConductivity2 = m_EarthConductivity2;
              DialogWindow.m_DialogEarthPermittivity2 = m_EarthPermittivity2;
              DialogWindow.m_Dialogfrequency = m_frequency;
              if (DialogWindow.DoModal() == IDOK)
              {
              m_NumCond = DialogWindow.m_DialogCon;
              m_Layers = DialogWindow.m_DialogLayers;
              m_AirPermeability = DialogWindow.m_DialogPermeability;
              m_AirConductivity = DialogWindow.m_DialogAirConductivity;
              m_AirPermittivity = DialogWindow.m_DialogAirPermittivity;
              m_EarthPermeability1 = DialogWindow.m_DialogEarthPermeability1;
              m_EarthConductivity1 = DialogWindow.m_DialogEarthConductivity1;
              m_EarthPermittivity = DialogWindow.m_DialogEarthPermittivity1;
              m_depth = DialogWindow.m_DialogDepth;
              m_EarthPermeability2 = DialogWindow.m_DialogEarthPermeability2;
              m_EarthConductivity2 = DialogWindow.m_DialogEarthConductivity2;
              m_EarthPermittivity2 = DialogWindow.m_DialogEarthPermittivity2;
              m_frequency = DialogWindow.m_Dialogfrequency;
              }

              }

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              A dialog does not seem the optimum choice for this. I would suggest switching to a CListView which allows much greater flexibility.

              L 1 Reply Last reply
              0
              • L Lost User

                A dialog does not seem the optimum choice for this. I would suggest switching to a CListView which allows much greater flexibility.

                L Offline
                L Offline
                lolici
                wrote on last edited by
                #7

                Can I edit data in a list view? Could you give me an example please or propose me a good tutorial for this case? cause I am new in programming.. :/

                L T 2 Replies Last reply
                0
                • L lolici

                  Can I edit data in a list view? Could you give me an example please or propose me a good tutorial for this case? cause I am new in programming.. :/

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  See CListView Class[^], CListView Search[^], etc.

                  1 Reply Last reply
                  0
                  • L lolici

                    Can I edit data in a list view? Could you give me an example please or propose me a good tutorial for this case? cause I am new in programming.. :/

                    T Offline
                    T Offline
                    ThatsAlok
                    wrote on last edited by
                    #9

                    lolici wrote:

                    Can I edit data in a list view?

                    Off course you can, advantage of using List View over Listbox is that you can create columns and ability of in place editing. Here is one such article ListCtrl Operations[^]

                    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