473,414 Members | 1,626 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,414 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 1238
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.