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. Control Instantiation

Control Instantiation

Scheduled Pinned Locked Moved C#
questiondesign
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.
  • T Offline
    T Offline
    terrier_jack
    wrote on last edited by
    #1

    Lets say I have a visual control with several properties set during design that will affect the display of the control. How do I ensure that the control is repainted after the properties are set in InitializeComponent? Is there a way to determine the order that the control's properties are initialized in InitializeComponent so that I can ensure that the last initialization causes a repaint? Or is there an event that I can overrride that fires when the initialization is complete?

    M M 2 Replies Last reply
    0
    • T terrier_jack

      Lets say I have a visual control with several properties set during design that will affect the display of the control. How do I ensure that the control is repainted after the properties are set in InitializeComponent? Is there a way to determine the order that the control's properties are initialized in InitializeComponent so that I can ensure that the last initialization causes a repaint? Or is there an event that I can overrride that fires when the initialization is complete?

      M Offline
      M Offline
      Marc Clifton
      wrote on last edited by
      #2

      terrier_jack wrote: How do I ensure that the control is repainted after the properties are set in InitializeComponent? I believe that is the purpose of the ISupportInitialize interface--it lets other things do all the property setup, then when the EndInit() method is called, your class can do whatever it needs to configure itself based on those property values. Marc MyXaml Advanced Unit Testing YAPO

      1 Reply Last reply
      0
      • T terrier_jack

        Lets say I have a visual control with several properties set during design that will affect the display of the control. How do I ensure that the control is repainted after the properties are set in InitializeComponent? Is there a way to determine the order that the control's properties are initialized in InitializeComponent so that I can ensure that the last initialization causes a repaint? Or is there an event that I can overrride that fires when the initialization is complete?

        M Offline
        M Offline
        MoustafaS
        wrote on last edited by
        #3

        Why can't you do as this: Public MyControl() { InitializeComponents(); this.refresh(); } As it will be refreshed after the call of the init() is returned and all the initialization is complete. Assuming that your visual properties will be user in the Overrode OnPaint Method .

        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