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. set control location on runtime

set control location on runtime

Scheduled Pinned Locked Moved C#
database
4 Posts 4 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.
  • A Offline
    A Offline
    Ajay R Ojha
    wrote on last edited by
    #1

    I want to set location of textboxes and labels at runtime. i get the coordinates from sql tables but when the location changes of 50 textboxes and labels the entire screen flickers and looks very bad. suggest me a way to change location without flickers. thanks.

    L Q M 3 Replies Last reply
    0
    • A Ajay R Ojha

      I want to set location of textboxes and labels at runtime. i get the coordinates from sql tables but when the location changes of 50 textboxes and labels the entire screen flickers and looks very bad. suggest me a way to change location without flickers. thanks.

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

      Try to use : SetStyle(ControlStyles.OptimizedDoubleBuffer, true);

      1 Reply Last reply
      0
      • A Ajay R Ojha

        I want to set location of textboxes and labels at runtime. i get the coordinates from sql tables but when the location changes of 50 textboxes and labels the entire screen flickers and looks very bad. suggest me a way to change location without flickers. thanks.

        Q Offline
        Q Offline
        quiteSmart
        wrote on last edited by
        #3

        you can use the form_onload event of the form and set there everything u need for the textboxes and for the labels. this event fires only once when the form is first loaded for the first time. hope it helps jamil abou khalil

        1 Reply Last reply
        0
        • A Ajay R Ojha

          I want to set location of textboxes and labels at runtime. i get the coordinates from sql tables but when the location changes of 50 textboxes and labels the entire screen flickers and looks very bad. suggest me a way to change location without flickers. thanks.

          M Offline
          M Offline
          Marc 0
          wrote on last edited by
          #4

          Maybe this?

          theTopLevelForm.SuspendLayout();
          // set the locations
          theTopLevelForm.ResumeLayout();


          "..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.." -- Mark McCormick


          || Fold With Us! || Pensieve || VG.Net ||

          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