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. Form designer - executing user control properties

Form designer - executing user control properties

Scheduled Pinned Locked Moved C#
designquestion
4 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.
  • A Offline
    A Offline
    AJ123
    wrote on last edited by
    #1

    Hi I have a user control which has a number of custom properties. Unfortunately these properties are not suitable for the designer to execute. As a result form’s which use this user control won’t open at design time in the designer. Is there some way to prevent the designer from executing my user control properties? Cheers Rich

    R J A 3 Replies Last reply
    0
    • A AJ123

      Hi I have a user control which has a number of custom properties. Unfortunately these properties are not suitable for the designer to execute. As a result form’s which use this user control won’t open at design time in the designer. Is there some way to prevent the designer from executing my user control properties? Cheers Rich

      R Offline
      R Offline
      Ravi Bhavnani
      wrote on last edited by
      #2

      You can check the control's DesignMode property to conditionally vary its behavior in order for it to be created by the designer. Alternatively, you could create the control at run time. /ravi My new year's resolution: 2048 x 1536 Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

      1 Reply Last reply
      0
      • A AJ123

        Hi I have a user control which has a number of custom properties. Unfortunately these properties are not suitable for the designer to execute. As a result form’s which use this user control won’t open at design time in the designer. Is there some way to prevent the designer from executing my user control properties? Cheers Rich

        J Offline
        J Offline
        Josh Smith
        wrote on last edited by
        #3

        Apply the [Browsable(false)] attribute to the properties which should not appear in the Properties window at design time. :josh: My WPF Blog[^]

        1 Reply Last reply
        0
        • A AJ123

          Hi I have a user control which has a number of custom properties. Unfortunately these properties are not suitable for the designer to execute. As a result form’s which use this user control won’t open at design time in the designer. Is there some way to prevent the designer from executing my user control properties? Cheers Rich

          A Offline
          A Offline
          AJ123
          wrote on last edited by
          #4

          Thanks Ravi + Josh, both solutions appear to work well :)

          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