473,406 Members | 2,619 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,406 software developers and data experts.

VB 2005 Express Drawline Help

Can anybody help me with a small piece of coding ?

I have used some code to draw a square within my form, using the drawline
function with in the Form1_Paint event handler.

With in this square, I wish to draw a line which originates from the bottom
right hand corner, and is of a length with in the square. The idea to
produce a form of Dial Gauge.

The origin point will always stay the same place, but opposite end of the
line is dependent upon the value of a textbox (say 1 to 10). Swing of this
line should be between the 3 o'clock and 12 o'Clock Positions.

If somebody can help with a sample of coding that I can experiment with. it
would be greatly appreciated.

Regard
Feb 7 '06 #1
1 1123
You're going to have to dust off your trig skills. If the value of the
textbox will indicate a percentage from 0 to 100, it might be easier.
You will have to figure a way to take that value and determine what
angle to draw the guage line at. If you let the 3 O'Clock position be
0 degrees and the 12 O'Clock position be 90 degrees. Then take the
percentage and multiply by 90 to get the angle. So 50% would be 45
degrees.

Once you know the angle you want, you will have to figure out the x,y
coordinates of the other end of the line. Using the law of sines or
cosines, you can take the origin point and the angle and the length of
the line to figure out the x,y coordinates of the opposite end.

Then you can draw your line using the two coordinate pairs.

Feb 7 '06 #2

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

Similar topics

2
by: johnb41 | last post by:
I just learned about, and am interested in 2 new products: Visual Basic 2005 Express Edition, and Visual Web Developer 2005 Express Edition. Just a few questions: Microsoft's web site says...
1
by: QLD_AU | last post by:
Has anyone see the following error ? VS 2005 Installs ok, however the SQL Mobile Edition (part of a full install) fails with the following error ? With Thanks Jason
1
by: Wade | last post by:
Is it possible to connect to a SQL 2005 Express db using Visual Basic 2005 Express? I cannot get past the connection.open statement without the error "...Version=2.0.0.0;...
2
by: Mark Petruszak | last post by:
I have the following code and I don't understand why I get a "Declaration expected" error for the myPen and formGraphics variables. Imports System.Drawing Public Class ucInfield Dim myPen As...
1
by: Peter | last post by:
I've purchased VS.NET 2005 Standard and have tried to install SQL Server 2005 Express, but get the following error in the error log. Please could someone help me.... Microsoft SQL Server 2005...
9
by: HC | last post by:
Hello, all, I started out thinking my problems were elsewhere but as I have worked through this I have isolated my problem, currently, as a difference between MSDE and SQL Express 2005 (I'll just...
25
by: Marco | last post by:
Hi everyone. I've been trying to move some small applications written in vb.net 2003 to vb.net 2005 express just for testing purposes. I have noticed so far that the applications seem to run ...
4
by: Slickuser | last post by:
How do I automatic move the X & Y to create a ellipse function as below, DrawCircle? Or there any sample source code out there? I want it move down by user input. How can I achieve this?...
6
by: Scott Gravenhorst | last post by:
Windows XP SP3 My application is set to open a SaveFile dialog when an exit is requested. When I click the app's close button, the save dialog opens, but when I click to change the folder, the...
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?
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
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...
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
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,...
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.