473,387 Members | 1,592 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.

Drawing Objects Cut Off Help

I am in my Visual Basic Class and when I draw a circle or any other objects with their dimensions, it cuts off. I know it is supposed to work, but it still cuts off.

Its frustrating has my instructor wants us to make a shape the size of the monitor, or at the minimum of 800 x 600.

Here is the code I currently have:

Expand|Select|Wrap|Line Numbers
  1. Public Class Form1
  2.     Dim myGraphics As Graphics = Me.CreateGraphics
  3.     Dim myPen As Pen
  4.     Dim myBrush As Brush
  5.     Dim myRectangle As New Rectangle
  6.  
  7.  
  8.     Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  9.  
  10.     End Sub
  11.  
  12.     Private Sub btnDraw_Click(sender As Object, e As EventArgs) Handles btnDraw.Click
  13.         myPen = New Pen(Drawing.Color.Blue, 5)
  14.         myBrush = New SolidBrush(Color.Coral)
  15.         myRectangle.X = 100
  16.         myRectangle.Y = 100
  17.         myRectangle.Width = 200
  18.         myRectangle.Height = 200
  19.         myGraphics.DrawEllipse(myPen, myRectangle)
  20.  
  21.  
  22.  
  23.     End Sub
  24. End Class
Attached Images
File Type: jpg dfsdfsefef.jpg (13.7 KB, 87 views)
Feb 25 '15 #1
4 1395
twinnyfo
3,653 Expert Mod 2GB
Have you tried different starting values for Lines 15-18, just to see if you can get any object that is not cut off?
Feb 25 '15 #2
Yes. It ends up the same way.
Feb 25 '15 #3
I figured it out. Essentially the dimensions have to be in the Button itself, not the form's universal placement.

Thank you.
Feb 27 '15 #4
twinnyfo
3,653 Expert Mod 2GB
I'm glad you found a solution and shared with the forum. Hopefully this can help others who have similar problems.
Feb 27 '15 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Phil Powell | last post by:
I am having to sort an array of objects by an arbitrary object field name that you are not going to know in advance, therefore, I cannot name the sorting function accordingly nor reference the...
1
by: James Beswick | last post by:
I want to do some primitive graphics work - drawing circles, squares, lines and enable the user to manipulate these on an Access form. All the drawing methods are on the report object so are there...
1
by: zengou | last post by:
My application have many picturebox objects,when run it ,sometimes i will have a strange error,how to work out ,help me please!(in windows98,the error cause frequently than in windowsxp) ...
0
by: Mike Starkey | last post by:
I have created a transparent control and I am using to to create drawing objects Inside the transparent objects I have created I am trying to using the draw shapes oval, rectangle etc. An example...
2
by: Chris | last post by:
I've been able to create a databgrid with files from a folder that I retrieve using Directory.GetFiles. I've read on the use of GetThumbnailImage but can not find a good tuturial on its use. I'd...
0
by: Ranginald | last post by:
I've been doing a lot of reading but I am still confused about asp.net membership and how it relates to sql server users and objects. Normally with sql server in a network setting it's easy to...
7
by: Donn Ingle | last post by:
Hi, I really hope someone can help me -- I'm stuck. I have written three versions of code over a week and still can't get past this problem, it's blocking my path to getting other code written. ...
1
by: sheephead86 | last post by:
Hi, I'm pretty new to java, and I have a small problem involving drawing a rectangle on a java applet.Firstly this is not a plea for someone to help me with this peice of work, I just need pointing...
1
by: cleary1981 | last post by:
Hi, I am working on a project which will involves drawing objects in SVG using co ordinates stored in a mysql database. Has anyone ever come across this. Ive seen on some forums where people say...
13
by: milk242 | last post by:
I know I'm making a mistake, but I'm wondering if someone could tell me the type of mistake I'm making. I know I can write the whole array to a file, but I want to create separate binary files for...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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: 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
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,...

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.