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. Windows Forms
  4. Adding & Removing properties of user controls

Adding & Removing properties of user controls

Scheduled Pinned Locked Moved Windows Forms
csharpquestionvisual-studiowinformsdesign
1 Posts 1 Posters 2 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
    abyclassic
    wrote on last edited by
    #1

    Dear All, I am making a Windows Control Library(user control) using VS.NET & C#.NET. Now, i am facing 3 problems: 1.In this control, i wants to remove some of the properties which are available by default to the controls. These properties must be removed from the 'Properties window' of the usercontrol. Also the user must not be able to set these properties using code. I am able to remove the properties from the 'Properties window' by inheriting a class from the System.Windows.Forms.Design.ScrollableControlDesigner & removing the properties by overriding the PreFilterProperties function as show below: protected override void PreFilterProperties(System.Collections.IDictionary properties) { properties.Remove("BackColor"); } But, doing so, this property is available to be set from the code. How can i remove this property fully? 2.I wants to create a property for the control which has sub properties, like the 'Location' property of a button, which has sub properties as 'X, Y & Locked'. My new property for the control must have some subproperties like this. How can i achieve this? 3.I wants to add a property to the user control which allows the user to select a color. When the user selects this property, it must display the same options which are displayed for selecting the color for the satndard properties like 'BackColor'. Then the user must be able to select the required color from these options & the value must be stored in that specific property. Kindly help me to acheieve the above scenarios Best Regards, Abhilash Chandran

    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