Custom activity appearance during running of the rehosting WWF designer

Source: Internet
Author: User

Recently, when using the workflow designer, a problem occurs. When you select an activity in the workflow, you must highlight it, not just a selection handle. The problem seems to be very simple. The simplest way to control the activity color is Activitydesignertheme You can also Designer In Onpaint Method, but I do not like this :).

In Designer. Of Onpaint Method Designer . Designer Of Designertheme You can directly obtain the design style for the attribute, and then Backcolorstart And Backcolorend Assigned a value to run... in full expectation ....... However, the system provides an exception with the following content:" Theme properties can only be changed in the theme configuration dialog. "; Then create a new Theme To Designer How? The answer is no, because Designertheme The attribute is read-only. This exploitation Theme But I didn't give up.

I took a closer look. Theme In Getbackgroundbrush Method.System. Drawing. drawing2d.Lineargradientbrush Type brush. Can I change the color of the brush? I tried it. Linearcolors Assigned value and run. The results are exciting!

Another unsolved problem is to determine whether the activity is selected. Designer There is an attribute Isselected , In Designer In Onpaint .

To sum up, if you only want to change the style at runtime, you cannot directly change the style attribute provided by the style, we can get the pen, brush, and other lower-level objects related to the drawing provided by the style, and then set them accordingly. For fonts Theme Moderate Font . If you are busy at work, try other tasks on your own.
For rehosting WWF designerArticle Please refer to my other articles:
Some technical details and Application Experience of WWF (1)
Some technical details and Application Experience of WWF (2)
Custom activity appearance during running of the rehosting WWF designer
Rehosting WWF designer-custom activity exterior
Rehosting WWF designerp drag activity from toolbox to designer
Rehosting WWF designer

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.