This repo is consists of CSS kind of implementation for windows forms, we can apply styles using classnames, controlnames and controltype.
Steps:
- DragDrop this component in UI.
- Set the ApplyStyle property to True for each control which needs to apply style.
- Default style file is styles.json , and default sheetname must present in file is sheet1 . "sheetname" : "sheet1" in styles.json ,
- if you configure the style with class name, please specify the classname in the control property.
- you can assign styles using controlType or classname or controlname etc.
- Property value which needs styles can be separated through "." dot, collections needs to represent as "[1]".
- For applying a image to a control, first we have to add resource.resx file and add item image as resource. for example in our demo we have added a "ImageResource.resx" file, then set the property "copy to output": "always" for that resx. then add that file path to styles.json in resxfiles section as mentioned in below snippet. then in BackgroundImage property value must be specified as "resx_path||filekey_name_inResx"
Sample Styles Definition: styles.json
- "resxfiles": ["ResxFiles//ImageResource.resx", "ResxFiles//ImageResource1.resx"],
- { "name":"TabPages[0].BackColor", "value":"Blue" },
- { "name":"Font", "value":"Microsoft Sans Serif, 10pt" },
- { "name":"BackColor", "value":"Blue" },
- { "name": "BackgroundImage", "value":"ResxFiles//ImageResource.resx||sample1" },
- { "name": "BackgroundImageLayout", "value":"Stretch" }


