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. Dynamic Control creation

Dynamic Control creation

Scheduled Pinned Locked Moved C#
helpquestion
3 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
    nilam2477
    wrote on last edited by
    #1

    I have a Panel wherein i place textboxes dynamically. I have set AutoScroll property for the Panel to true. So when the size exceeds automatically Vertical Scroll bar appears. I place dynamic textboxes in sequential order i.e one after the other row wise. I calculate the exact Location and place the control. This works fine. The problem happens when i use the scroll bar to scroll down and then add few more TextBoxes. Now the location of the new added Text Box after scroll is not properly placed. Eventhough the calculation is the same. There is more gap between the previous and the next TextBox control. Why?

    G 1 Reply Last reply
    0
    • N nilam2477

      I have a Panel wherein i place textboxes dynamically. I have set AutoScroll property for the Panel to true. So when the size exceeds automatically Vertical Scroll bar appears. I place dynamic textboxes in sequential order i.e one after the other row wise. I calculate the exact Location and place the control. This works fine. The problem happens when i use the scroll bar to scroll down and then add few more TextBoxes. Now the location of the new added Text Box after scroll is not properly placed. Eventhough the calculation is the same. There is more gap between the previous and the next TextBox control. Why?

      G Offline
      G Offline
      Gopal S
      wrote on last edited by
      #2

      Hi, First you should set the position of the Vertical Scroll into "0", then add the controls to the panel. Now it works fine. this.panel1.VerticalScroll.Value = 0; this.panel1.Controls.Add(objTextBox); Regards,

      Gopal.S

      N 1 Reply Last reply
      0
      • G Gopal S

        Hi, First you should set the position of the Vertical Scroll into "0", then add the controls to the panel. Now it works fine. this.panel1.VerticalScroll.Value = 0; this.panel1.Controls.Add(objTextBox); Regards,

        Gopal.S

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

        Thanks a lot for your help. I tried setting the position of Vertical scroll to 0 and it worked. Regards,

        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