These days Moore's Law is more alive than ever. As such, developers are paying a lot more attention to the 'User Experience'. There are companies like Infragistics and Component One who's sole product lines involve UI enhancing tools.
Ok, so let's say you want to use a common technique that's pretty popular these days, the Gradient. It's a LOT easier than you might think. (Combine this with the techniques I mention in my Opacity article, and you can really get cool. Anyway, it's a lot easier than you might think. The code is pretty self explanatory:
| Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint Dim BaseRectangle As New Rectangle(0, 0, Me.Width - 1, Me.Height - 1) 'You can use whatever colours you want, I just chose Orange and Green so that 'because they are the colors of my Beloved Hurricanes 'Anyway, all that's happening is that I declare a rectangle to match the surface 'area of the form (BaseRectangle), pick Two Colors, and then select an Angle for your gradient. 'Yes, pretty simple, but after all, isn't that what .NET is supposed to be about? Dim Gradient_Brush As New LinearGradientBrush(BaseRectangle, Color.Orange, Color.Green, 45) e.Graphics.FillRectangle(Gradient_Brush, BaseRectangle) End Sub |
| Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize Me.Invalidate() End Sub |
| Me.Invalidate(New Rectangle(0, 0, 100, 100)) |