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. Visual Basic
  4. Visual Basic .net - Form loading

Visual Basic .net - Form loading

Scheduled Pinned Locked Moved Visual Basic
csharphardwarequestionworkspace
3 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.
  • N Offline
    N Offline
    No e
    wrote on last edited by
    #1

    I am in the process of converting a project from vb6 to vb.net. Code is now re-written and I can run it. The first thing I see is that when I select and option to load a form from my main screen, I see lots of animation which I assume to be me moving my controls around, before the form clears itself up and looks like I wanted it to. I have anywhere from 100 to 300 text boxes, labels buttons and so-on that I arrange based on the system configuration. This is all done dynamically in code as the form loads because they can be vertical, horizontal, different quantities and so-on based on what type of hardware it is connected to. I tried making the form not visible in the load event but no luck, any other suggestions? It was very clean in VB6 No-e

    D L 2 Replies Last reply
    0
    • N No e

      I am in the process of converting a project from vb6 to vb.net. Code is now re-written and I can run it. The first thing I see is that when I select and option to load a form from my main screen, I see lots of animation which I assume to be me moving my controls around, before the form clears itself up and looks like I wanted it to. I have anywhere from 100 to 300 text boxes, labels buttons and so-on that I arrange based on the system configuration. This is all done dynamically in code as the form loads because they can be vertical, horizontal, different quantities and so-on based on what type of hardware it is connected to. I tried making the form not visible in the load event but no luck, any other suggestions? It was very clean in VB6 No-e

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Frankly, I wouldn't be doing what you described. 300 controls on a form is excessive and takes forever to render. Rearranging them from their initial layout just makes things worse. I'd probably be skipping the textboxes all together unless these values can be updated. In either case, I'd look at compartmentalizing these in logical groups and creating controls or usercontrols that handle/rearrange/draw themselves depending on the data that's passed to them. You could then create instances of only those controls you need at runtime. Form.Load only happens the first time a form is displayed and happens just before it's shown. You'll get another event, VisibleChanged, when that happens. The earliest event you get from a form is HandleCreated.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak

      1 Reply Last reply
      0
      • N No e

        I am in the process of converting a project from vb6 to vb.net. Code is now re-written and I can run it. The first thing I see is that when I select and option to load a form from my main screen, I see lots of animation which I assume to be me moving my controls around, before the form clears itself up and looks like I wanted it to. I have anywhere from 100 to 300 text boxes, labels buttons and so-on that I arrange based on the system configuration. This is all done dynamically in code as the form loads because they can be vertical, horizontal, different quantities and so-on based on what type of hardware it is connected to. I tried making the form not visible in the load event but no luck, any other suggestions? It was very clean in VB6 No-e

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

        InterOp to LockWindowUpdate API could be used to disable drawing for a sec.

        Bastard Programmer from Hell :suss:

        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