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. Adding Controls in Runtime

Adding Controls in Runtime

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++question
5 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.
  • I Offline
    I Offline
    InOut NET
    wrote on last edited by
    #1

    I'm Frustrated. in .NET a easy Control.Add(new TextBox()) will create a textbox during runtime. Do anyone know of a way to add controls to a panel during runtime? (or form) And also may someone point me to some litrature that *explains* the advanced methods with respect to controls and control containers in C++ VCL? Appreciate it

    H M 2 Replies Last reply
    0
    • I InOut NET

      I'm Frustrated. in .NET a easy Control.Add(new TextBox()) will create a textbox during runtime. Do anyone know of a way to add controls to a panel during runtime? (or form) And also may someone point me to some litrature that *explains* the advanced methods with respect to controls and control containers in C++ VCL? Appreciate it

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #2

      You can use of Create or CreateWindow or you can declare a variable for example CButton m_button; m_Button.Create(...); and after create it declare events for it.


      WhiteSky


      1 Reply Last reply
      0
      • I InOut NET

        I'm Frustrated. in .NET a easy Control.Add(new TextBox()) will create a textbox during runtime. Do anyone know of a way to add controls to a panel during runtime? (or form) And also may someone point me to some litrature that *explains* the advanced methods with respect to controls and control containers in C++ VCL? Appreciate it

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

        In addition to WhiteSky's reply... Everything you ever wanted to know (and more) about Windows controls can be found here: Individual Control Information[^] Mark

        Mark Salsbery Microsoft MVP - Visual C++ This episode brought to you by the letter Z

        I 1 Reply Last reply
        0
        • M Mark Salsbery

          In addition to WhiteSky's reply... Everything you ever wanted to know (and more) about Windows controls can be found here: Individual Control Information[^] Mark

          Mark Salsbery Microsoft MVP - Visual C++ This episode brought to you by the letter Z

          I Offline
          I Offline
          InOut NET
          wrote on last edited by
          #4

          Thanks for Info, I got it. The Create and CreateWindows seemed to be a bit low level programming. I found a InsertControl(TWinControl*) on the panel that i missed. It works perfect. I program in Borland using VCL - so the Create does not exist. Thanks anyhow.

          M 1 Reply Last reply
          0
          • I InOut NET

            Thanks for Info, I got it. The Create and CreateWindows seemed to be a bit low level programming. I found a InsertControl(TWinControl*) on the panel that i missed. It works perfect. I program in Borland using VCL - so the Create does not exist. Thanks anyhow.

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

            InOut.NET wrote:

            I program in Borland using VCL

            :omg: I missed that :) We were referring to Windows APIs, so yes, low level. Cheers! Mark

            Mark Salsbery Microsoft MVP - Visual C++ This episode brought to you by the letter Z

            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