473,395 Members | 1,608 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,395 software developers and data experts.

Sizing/filling a rectangle

Hey folks,

I'm trying to make my own progressbar. The idea (for my test) is a
rectangle that is 1/60 filled with a color per second (so after a
minute it is all filled).

This is what I have so far:

Public Sub DrawRectangleFloat(ByVal e As PaintEventArgs)

Dim g As Graphics = e.Graphics 'get graphics object
Dim rpen As New Pen(System.Drawing.Color.Blue, 1)

Dim blueBrush As New SolidBrush(Color.Blue)

Dim myWidth As Integer
myWidth = (320 / 60) * iSecond

g.DrawRectangle(rpen, 15, 224, 320, 15)
g.FillRectangle(blueBrush, 15, 224, myWidth, 15)

End Sub
1.
On Timer_Tick I want to execute the above procedure, but I don't know
with what to call it: DrawRectangleFloat(?). What should be in the
paranthesis?

2.
It's kind of awkwad that I draw the rectangle each time. It should be
done once, and then only filled. But I don't know how to "save" it so
that I can refer to it...does it have a name, once drawn?
Am I on the right path at all? Thnx in advance!
Regards /Snedker
Nov 21 '05 #1
1 1015

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

Similar topics

2
by: Mark McKay | last post by:
I have an application that needs to quickly draw solid rectangles of uniform color on Images and VolitileImages. I was surprised in a recent benchmark to find that Graphics.fillRect(x1, y1, x2,...
15
by: Steven T. Hatton | last post by:
The following may strike many of you as just plain silly, but it represents the kind of delelima I find myself in when trying to make a design decision. This really is a toy project written for...
3
by: | last post by:
I am having a hard time understanding the logic behind the Rectangle object. My problem has to do with the way the rectangle treats the "Width" property. For example, take the following rectangle...
5
by: Rainer Queck | last post by:
Hi NG, how can I size a mdi child to that it fits exactliy into "available" client rectangle of a mdi container without setting its WindowState to Maximized? On my MDI main form I have a...
0
by: CharChabil | last post by:
Hey Guys Kindly help me with the following function in vb.net 2005 I want to write a function that does the following 1. Go to pixels (x,y) 2. Draw a circle or a rectangle at the above pixels,...
4
by: RobinS | last post by:
I am drawing a rectangle on a picture that has already been drawn on the graphics area (a user control). It works something like this: //in the MouseDown event m_isDragging = true; m_oldX =...
1
by: jateennaran | last post by:
Hi I would like to know why is it that when I draw a rectangle onto the form at 400 pixels high, when I count the number of pixels on my PC, I count 401 pixels. I've checked it on other computers and...
5
by: Kevin R | last post by:
How do you create those small textfields that I see for inputing passwords and such? Kevin
9
by: Jeff | last post by:
I've always set form element sizes by using size on textfields and rows and cols on textareas. That's always lead to inconsistencies and a bit of guesswork when you want a form element to fill a...
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
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.