Results 1 to 8 of 8

Thread: [THEME] Butterscotch Theme GDI+ 20 Controls VB.Net

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2004
    Location
    THANE
    Posts
    37

    [THEME] Butterscotch Theme GDI+ 20 Controls VB.Net

    Butterscotch Theme GDI+ - My Sixth Theme


    Inspiration & Credit to all Theme Creators of the HF

    Controls -

    1) Butterscotch Theme (with Border & Blinking caption)
    2) Butterscotch Alert Box (with Success, Error, Info option)
    3) Butterscotch Button
    4) Butterscotch Check Box
    5) Butterscotch Combo Box
    6) Butterscotch Control Box (Minimize & Maximize buttons can be disabled)
    7) Butterscotch Group Box
    8) Butterscotch Horizontal Separator
    9) Butterscotch Label (Show/Hide Border)
    10) Butterscotch List Box
    11) Butterscotch Panel
    12) Butterscotch Progress Bar (Show/Hide Percentage Value)
    13) Butterscotch Progress Button (Combination of Button & Progress Bar)
    14) Butterscotch Radio Button
    15) Butterscotch Tab Control
    16) Butterscotch Text Box
    17) Butterscotch Toggle
    18) Butterscotch Vertical Progress Bar (Show/Hide Percentage Value)
    19) Butterscotch Vertical Separator
    20) Butterscotch Vertical Tab Control


    Screenshot -

    Original Image -



    My Theme -

    Colours & shape changed as it may look similar with Lord Pankake's Theme if he makes it...






    Download -
    http://pastebin.com/Cw0nUHtj


    Note -
    1) This is my Sixth Theme... written while learning so it may have bugs...

    2) Theme is coded without Themebase...

    3) Constructive Criticism & Suggestions are always welcome...

    4) Please leave comments for encouragement...

    5) Will add more controls if you find it useful & need arises...

    6) Credits to "Aeonhack" for Roundrect function...

    7) Credits to "Mephobia" for NoiseBrush Function...

    8) AlertBox Control idea taken from "iSynthesis'" Flat UI theme


    Regards
    Saket
    From Manoj's Desk

  2. #2
    Addicted Member
    Join Date
    Jan 2010
    Posts
    250

    Re: [THEME] Butterscotch Theme GDI+ 20 Controls VB.Net

    he is very very good...very very good...

  3. #3
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    537

    Re: [THEME] Butterscotch Theme GDI+ 20 Controls VB.Net

    What is this?
    what is it for?
    How do I use it.
    I am not being a smart*ss . I am clueless, I've loaded the code and run it ? What now?
    Thank for helping to understand
    george

  4. #4
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,598

    Re: [THEME] Butterscotch Theme GDI+ 20 Controls VB.Net

    How did you load the code?
    One way to play with it:
    Start a new project.
    Add a Module file from the Build menu.
    Paste the Butterscotch code in place of the default code added to the module.
    Build the project from the Build menu.
    Now, if you're on the Form design page, select Toolbox and you should see a list of a bunch of "Butterscotch" controls that you can use on your form.

  5. #5
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,598

    Re: [THEME] Butterscotch Theme GDI+ 20 Controls VB.Net

    I gave it a quick try, adding some buttons, and was a bit surprised there was no feedback when you pressed a button.
    The Rollover indication and mousedown indication are the same, so nothing appears to happen when you press the button.
    So, I added a line to do the standard shift down and to the right one pixel in the mouse down state.
    In the OnPaint override sub of the ButterscotchButton class added the indicated (<=====) TranslateTransform line

    <edit> I checked a "regular" winform button and noticed it doesn't do the button shift to indicate selection. It just changes to a slightly darker background color.
    I guess the code should be changed to draw a darker gradientBrush for mousedown, rather then do the transformTranslate (although I didn't think the movement looked all that bad).
    </edit>

    Code:
          Case MouseState.Down
            Dim buttonrectdown As New LinearGradientBrush(innerrect, Color.FromArgb(48, 43, 39), Color.FromArgb(100, 90, 80), LinearGradientMode.Vertical)
            g.TranslateTransform(1, 1)          '<===== Indicate button press by shifting button down and right one pixel
            g.FillPath(New SolidBrush(Color.FromArgb(26, 25, 21)), RoundRect(rect, 3))
            g.FillPath(buttonrectdown, RoundRect(innerrect, 3))
            g.DrawString(Text, btnfont, Brushes.White, innerrect, New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
    p.s. Also noticed that the order of action in the toggle button and radio button's OnClick event processing are out of order.
    It is common in the application level Click event of radio and checkbox controls to check the current state of the control. The new state of the control, as a result of clicking on the control is set before the user gets the click event.

    In the Butterscotch controls, the new state was set after the application level click event was generated, so you are looking at the previous state in the click event, not the current state.
    For example, the Toggle button code was
    Code:
      Protected Overrides Sub OnClick(ByVal e As EventArgs)
        MyBase.OnClick(e)
        If Not Checked Then Checked = True Else Checked = False
      End Sub
    Calling the default processing, MyBase.OnClick(e), before doing the local processing is the issue.
    So I changed the code to:
    Code:
      Protected Overrides Sub OnClick(ByVal e As EventArgs)
        Checked = Not Checked 
        MyBase.OnClick(e)
      End Sub
    Now the Checked state gets toggled before the default processing is done, so is already changed when the user gets the Click Event.
    Also, since we're just toggling a boolean, got rid of the If Then Else statement and just toggle the boolean.
    Last edited by passel; Dec 1st, 2014 at 01:56 AM.

  6. #6

    Thread Starter
    Member
    Join Date
    Feb 2004
    Location
    THANE
    Posts
    37

    Re: [THEME] Butterscotch Theme GDI+ 20 Controls VB.Net

    Quote Originally Posted by passel View Post
    I gave it a quick try, adding some buttons, and was a bit surprised there was no feedback when you pressed a button.
    The Rollover indication and mousedown indication are the same, so nothing appears to happen when you press the button.
    So, I added a line to do the standard shift down and to the right one pixel in the mouse down state.
    In the OnPaint override sub of the ButterscotchButton class added the indicated (<=====) TranslateTransform line

    <edit> I checked a "regular" winform button and noticed it doesn't do the button shift to indicate selection. It just changes to a slightly darker background color.
    I guess the code should be changed to draw a darker gradientBrush for mousedown, rather then do the transformTranslate (although I didn't think the movement looked all that bad).
    </edit>

    Code:
          Case MouseState.Down
            Dim buttonrectdown As New LinearGradientBrush(innerrect, Color.FromArgb(48, 43, 39), Color.FromArgb(100, 90, 80), LinearGradientMode.Vertical)
            g.TranslateTransform(1, 1)          '<===== Indicate button press by shifting button down and right one pixel
            g.FillPath(New SolidBrush(Color.FromArgb(26, 25, 21)), RoundRect(rect, 3))
            g.FillPath(buttonrectdown, RoundRect(innerrect, 3))
            g.DrawString(Text, btnfont, Brushes.White, innerrect, New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
    p.s. Also noticed that the order of action in the toggle button and radio button's OnClick event processing are out of order.
    It is common in the application level Click event of radio and checkbox controls to check the current state of the control. The new state of the control, as a result of clicking on the control is set before the user gets the click event.

    In the Butterscotch controls, the new state was set after the application level click event was generated, so you are looking at the previous state in the click event, not the current state.
    For example, the Toggle button code was
    Code:
      Protected Overrides Sub OnClick(ByVal e As EventArgs)
        MyBase.OnClick(e)
        If Not Checked Then Checked = True Else Checked = False
      End Sub
    Calling the default processing, MyBase.OnClick(e), before doing the local processing is the issue.
    So I changed the code to:
    Code:
      Protected Overrides Sub OnClick(ByVal e As EventArgs)
        Checked = Not Checked 
        MyBase.OnClick(e)
      End Sub
    Now the Checked state gets toggled before the default processing is done, so is already changed when the user gets the Click Event.
    Also, since we're just toggling a boolean, got rid of the If Then Else statement and just toggle the boolean.
    Thanks for the info, i will look into it
    From Manoj's Desk

  7. #7
    Lively Member
    Join Date
    Aug 2011
    Posts
    66

    Re: [THEME] Butterscotch Theme GDI+ 20 Controls VB.Net

    Hey. I very liked your theme.
    My question is, what is the license? Can I use it in my projects freely? Thanks!

  8. #8

    Thread Starter
    Member
    Join Date
    Feb 2004
    Location
    THANE
    Posts
    37

    Re: [THEME] Butterscotch Theme GDI+ 20 Controls VB.Net

    Quote Originally Posted by Zeev View Post
    Hey. I very liked your theme.
    My question is, what is the license? Can I use it in my projects freely? Thanks!
    It's shared as free... You can use it the way you want but just don't remove credits provided at start. You can even edit it, change colours etc...

    To use it just add new class to your project add complete theme contents to it, then compile & add controls the way you add normal controls...

    Regards
    From Manoj's Desk

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