473,387 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Gradient window

I found this code on the internet. It failed because it seems that line
number 24 is not ready. The parameter lb is not declared. How should I
implement this?

Please help! D.G. Norway

The Code:

01 Private Sub Form1_Resize(ByVal sender As Object, _
02 ByVal e As System.EventArgs) Handles MyBase.Resize
03
04
05 MakeGradient()
06 End Sub
07
08 Private Sub Form1_Activated(ByVal sender As Object, _
09 ByVal e As System.EventArgs) Handles MyBase.Activated
10
11
12 MakeGradient()
13 End Sub
14
15 Private Sub MakeGradient()
16 Dim objBrush As New Drawing2D.LinearGradientBrush _
17 (Me.DisplayRectangle, _
18 Color.Blue, _
19 Color.AliceBlue, _
20 Drawing2D.LinearGradientMode.Vertical)
21
22 Dim objGraphics As Graphics = Me.CreateGraphics()
23
24 objGraphics.FillRectangle(lb, Me.DisplayRectangle)
25
26 objBrush.Dispose()
27 objGraphics.Dispose()
28 End Sub
Nov 20 '05 #1
2 1236
Change lb in this line:
objGraphics.FillRectangle(lb, Me.DisplayRectangle)

with objBrush:
objGraphics.FillRectangle(objBrush, Me.DisplayRectangle)
I found this code on the internet. It failed because it seems that line
number 24 is not ready. The parameter lb is not declared. How should I
implement this?

Please help! D.G. Norway

The Code:

01 Private Sub Form1_Resize(ByVal sender As Object, _
02 ByVal e As System.EventArgs) Handles MyBase.Resize
03
04
05 MakeGradient()
06 End Sub
07
08 Private Sub Form1_Activated(ByVal sender As Object, _
09 ByVal e As System.EventArgs) Handles MyBase.Activated
10
11
12 MakeGradient()
13 End Sub
14
15 Private Sub MakeGradient()
16 Dim objBrush As New Drawing2D.LinearGradientBrush _
17 (Me.DisplayRectangle, _
18 Color.Blue, _
19 Color.AliceBlue, _
20 Drawing2D.LinearGradientMode.Vertical)
21
22 Dim objGraphics As Graphics = Me.CreateGraphics()
23
24 objGraphics.FillRectangle(lb, Me.DisplayRectangle)
25
26 objBrush.Dispose()
27 objGraphics.Dispose()
28 End Sub

Nov 20 '05 #2
Change lb in this line:
objGraphics.FillRectangle(lb, Me.DisplayRectangle)

with objBrush:
objGraphics.FillRectangle(objBrush, Me.DisplayRectangle)
I found this code on the internet. It failed because it seems that line
number 24 is not ready. The parameter lb is not declared. How should I
implement this?

Please help! D.G. Norway

The Code:

01 Private Sub Form1_Resize(ByVal sender As Object, _
02 ByVal e As System.EventArgs) Handles MyBase.Resize
03
04
05 MakeGradient()
06 End Sub
07
08 Private Sub Form1_Activated(ByVal sender As Object, _
09 ByVal e As System.EventArgs) Handles MyBase.Activated
10
11
12 MakeGradient()
13 End Sub
14
15 Private Sub MakeGradient()
16 Dim objBrush As New Drawing2D.LinearGradientBrush _
17 (Me.DisplayRectangle, _
18 Color.Blue, _
19 Color.AliceBlue, _
20 Drawing2D.LinearGradientMode.Vertical)
21
22 Dim objGraphics As Graphics = Me.CreateGraphics()
23
24 objGraphics.FillRectangle(lb, Me.DisplayRectangle)
25
26 objBrush.Dispose()
27 objGraphics.Dispose()
28 End Sub

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Woody Splawn | last post by:
I have a webform where I would like to have the background color for the webform be a gradient in blue. How do I do this? What is the easiest way? What is the way most used by other developers? ...
4
by: Wayne Wengert | last post by:
I'm looking for information or samples of how to display a gradient background color for an ASP.NET web page. I want to be able to set a start and end color (e.g. Light Orange to White) and have...
13
by: Crirus | last post by:
The main ideea: I havea 513x513 array of values....I draw a sort of map using that values for colors... so I have a realistic lanscape (map). I want to zoom about 60 times that map...and the...
11
by: Maximus | last post by:
Hi all, Has anyone been able to reterive the gradient selection colors used in outlook 2003? Basically, I have a grid showing a list of records and my client wants the selected row to have the...
0
by: Dan Baumbach | last post by:
I'm working on a toolbar for IE. I have everything working well but I'm unable to get the toolbar to have the same gradient background under XP that other toolbars on IE have. To start with, I...
2
by: skylargivens | last post by:
I've created an application for Windows XP but I'm having trouble getting the right "look". I'd like my application to look somewhat like the Windows Vista sidebar:...
4
by: Jon Slaughter | last post by:
I'm drawing a linear gradient and its very "banded". The colors are far enough part that it should be plenty smooth enough but I always get the same number of bands regardless. I've tried to set...
1
by: madladuk | last post by:
Hi all. Does anyone have any example of how to do a gradient background whilst moving over graphics and text like the Microsoft web site. On the MS site when you select an area a window popup...
6
by: moondaddy | last post by:
I want to fill the entire background of a page with a gradient. As a test, I first filled with a solid color like this: <body style="background-color: #ccffff;" > and the entire page was this...
9
by: Eric Lindsay | last post by:
How do you provide a consistent gradient fill as a background in a liquid layout? If I make a gradient fill image say 1000 pixels wide (and repeat it down the page) to suit a typical computer...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.