Results 1 to 9 of 9

Thread: Gradient [RESOLVED]

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    124

    Resolved Gradient [RESOLVED]

    How can I make a background colour of a form a gradient between two selected colours? I know I could use a background image, but that would make the filesize unnecessarily bigger.

    Thanks for any help.
    Last edited by martw; Jun 10th, 2005 at 03:27 AM. Reason: resolved.
    I never know what to put in this section...



    So sue me... ... ... I'm just kidding...


    www.fat-pie.com Flash Movies... You gotta see 'em to believe 'em!

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Gradient

    You can use the Graphics class to draw the gradient colors.
    VB Code:
    1. Imports System.Drawing.Drawing2D
    2.  
    3. Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
    4.     e.Graphics.FillRectangle(New LinearGradientBrush(Me.ClientRectangle, Color.Red, Color.Blue, LinearGradientMode.ForwardDiagonal), Me.ClientRectangle)
    5. End Sub
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    124

    Re: Gradient

    Cool, thanks Rob

    Is there a site that shows things I can do with System.Srawing.Drawing2D? I would like to learn more about its capabilities.
    I never know what to put in this section...



    So sue me... ... ... I'm just kidding...


    www.fat-pie.com Flash Movies... You gotta see 'em to believe 'em!

  4. #4
    Addicted Member
    Join Date
    Jan 2004
    Location
    North east UK
    Posts
    129

    Re: Gradient

    You could also download the vbpowerpack from Microsoft. This has a blend panel control included.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    124

    Re: Gradient

    Where can I find this 'vbpowerpack'?
    I never know what to put in this section...



    So sue me... ... ... I'm just kidding...


    www.fat-pie.com Flash Movies... You gotta see 'em to believe 'em!

  6. #6
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: Gradient

    microsoft.com would be a sensible starting place.
    I don't live here any more.

  7. #7
    Addicted Member
    Join Date
    Jan 2004
    Location
    North east UK
    Posts
    129

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    124

    Re: Gradient

    ROFL, I see what you mean... I need to look for it myself.. I know
    I never know what to put in this section...



    So sue me... ... ... I'm just kidding...


    www.fat-pie.com Flash Movies... You gotta see 'em to believe 'em!

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    124

    Re: Gradient

    Dudes! Thats Powerpack is friggin awesome Thank!!!
    I never know what to put in this section...



    So sue me... ... ... I'm just kidding...


    www.fat-pie.com Flash Movies... You gotta see 'em to believe 'em!

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