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 Studio
  4. Detect if control is hosted in the Visual Studio designer?

Detect if control is hosted in the Visual Studio designer?

Scheduled Pinned Locked Moved Visual Studio
csharpdatabasevisual-studiodesignquestion
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.
  • T Offline
    T Offline
    Tormod Fjeldskaar
    wrote on last edited by
    #1

    I'm creating an animated custom control using System.Windows.Forms.Timer as the animation trigger. I would like to freeze the animation during design time, however, as the animation may disturb the user. Is it possible to detect somehow that that the control is hosted in the Visual Studio designer?

    P 1 Reply Last reply
    0
    • T Tormod Fjeldskaar

      I'm creating an animated custom control using System.Windows.Forms.Timer as the animation trigger. I would like to freeze the animation during design time, however, as the animation may disturb the user. Is it possible to detect somehow that that the control is hosted in the Visual Studio designer?

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      Try checking if ( !this.DesignMode ) ...

      T 1 Reply Last reply
      0
      • P PIEBALDconsult

        Try checking if ( !this.DesignMode ) ...

        T Offline
        T Offline
        Tormod Fjeldskaar
        wrote on last edited by
        #3

        I forgot to mention that I'm working with .NET Compact Framework, but your answer helped me enough to find the solution. On Compact Framework I had to check for this.Site.DesignMode rather than just this.DesignMode. Thanks a lot :)

        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