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. Web Development
  3. Where is my component's Style?!?!?

Where is my component's Style?!?!?

Scheduled Pinned Locked Moved Web Development
csswpfdesignsysadminhelp
1 Posts 1 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.
  • H Offline
    H Offline
    howardjr
    wrote on last edited by
    #1

    I've built a custom web/server-side component ComboBox. However, when I tried to explicitly handle property assignments to the Style I get a message saying that that property may only be set at runtime. In my component I actually have three webcontrols: a image-button, a listbox, and a textbox, which in my code, I use as storage for the various properties that my component supports, including the Style properties for each of these controls using distinctive properties for each one: ImageStyle, ListBoxStyle, and TextBoxStyle. And this works for them. Then, as I said at the top of this message, I wanted to create an explicit property for the base class's Style property, and got the error, so I created a new one called ComponentStyle, and changed the Style in my component's tag from Style to ComponentStyle, but nothing shows in the ComponentStyle property in the Designer's Property Window. Strangely, the inline style values are getting rendered in the web-page, so they are being loaded, just not showing in the designer. Here is the code I'm using for my Style and ComponentStyle properties:

    ' --------------- Property Style --------------------------------
    	' Setting Browsable to False to hide this property from the Designer Property window.
    	' This property uses Shadow to allow me declare the Browsable directive.
    
    	<Browsable(False), Category("Component"), DefaultValue(""), _
    	 Description("Component level inline CSS string")> _
    	Public Shadows ReadOnly Property [Style]() As System.Web.UI.CssStyleCollection
    		Get
    			Return MyBase.Style
    		End Get
    	End Property ' Style
    
    	' ----------- Property ComponentStyle --------------------------
    	' This is the public version of the above property.
    	'
    	' The Getter uses the CssStyleCollectionAsString
    	' function to build a string containing the
    	' MyBase Style settings.
    	'
    	' The Setter uses the
    	' ApplyCssStyleStringToCssStyleCollection function
    	' to set the MyBase Style setting from a string.
    	'
    	' I know that these helper functions work, I use
    	' them on through out my program on the other
    	' components, including CssStyleCollectionAsString
    	' in the designer to render the component's styles
    	' for the editor.
    	'
    
    	<Browsable(True), Category("Component"), DefaultValue(""), _
    	 Description("Component level inline CSS string")> _
    	Public Property [ComponentStyle]() As String
    		Get
    			Return CssStyleCollectionAsString(MyBase.Style)
    		End Get
    		Set(ByVal Value As String)
    			ApplyCssStyleStringToCssStyleCol
    
    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