Results 1 to 1 of 1

Thread: [.NET 3.5+] BorderStyles Enum With Designer Editor (Custom Drawing)

  1. #1

    Thread Starter
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    [.NET 3.5+] BorderStyles Enum With Designer Editor (Custom Drawing)

    This code bank submission is aimed more so at people that either want to learn how to create a design editor for Enums, or people that like doing custom drawing.

    Often times when you're creating a custom control, such as a custom button you will add a property called BorderColor or something to that effect. This code is so you can add a property called BorderStyles where you can select which borders to draw. Of course this could be used for whatever you like. This was coded with 3.5 framework, and as such it uses a little LINQ and initializer syntax, although 99% of the code is compatible with 2.0, you will just have to change a couple things.

    Here are some screen shots of what the code does:

    Screen shot of the Properties editor in VS where I have a custom control that has a property called "BorderStyle".



    Screen shot of what happens when you edit the BorderStyle by clicking the drop down:



    Attached is the code.

    If something is not working for you, please review this question list before asking:

    1) Did you add all the right references?
    2) Did you add this file via Project > Add Existing Item?
    3) Did you qualify the editor name like it says above the Enum in the comments?
    Attached Files Attached Files
    Last edited by ForumAccount; Apr 5th, 2011 at 10:59 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width