Using Loop To Draw Different Shapes
May 25, 2011
I want to use a loop to draw different types of shapes on a visual. I want to use the Random function sothat the number of each shape would be set randomly. For example, I want three triangles followed by two circles, followed by two triangles, etc. When you click the button again a different set of shapes would be rendered. I can draw shapes. What I need is how to use the loops and Random() to do this. I tried to use concatenation but it does not work with the Polygons.
View 15 Replies
ADVERTISEMENT
Dec 4, 2009
Can I draw my own shapes (such as a filled circle, square, etc.) on a form?Can it be done from code as well as from the designer?Can I use events such as onClick() on the shapes?
View 3 Replies
Mar 17, 2011
I have a control that looks similar to the following:
I need to add slightly round ends where all that extra end space is. I'm not sure how to add these. It should look similar to the round ends on this page.
View 1 Replies
Aug 11, 2010
I'm creating new buttons at runtime that I need to draw on. I have 4 different and I need to draw different shapes on them. I've started with the "rectangle button" and I've approached this
[Code]...
View 3 Replies
Feb 15, 2006
The image editor toolbar is not active. I would like to draw lines and shapes on a form.
View 1 Replies
Sep 12, 2010
I'd like to draw variety of shapes to represent opreational space occupied of various rooms. I am interest to develop a web based application using visual studio and would like to use asp.net platform and the language I'll be using is VB.
View 3 Replies
Jun 8, 2011
I've to show some PowerPacks.RectangleShape in a PowerPacks.ShapeContainer. A loop in my code add shapes to the container
(objshapecontainer.shapes.add(objshape), but at the end of the loop, only the last shape is displayed, in fact objshapecontainer.shapes.count doesn't exceed 1
View 1 Replies
Dec 10, 2010
I wanted to draw a chart on a picture box. So I create a form, put a picture box on it, and then in the code of Form_load, I put a handler to the paint event of the picture box. This seems to create an infinite loop, judging from the behavior of the form.
View 19 Replies
Dec 3, 2009
I wanna make shapes like vb6 but i don't have shapes like that. i need to make them an array.is there any component or something to use like shapes?
View 3 Replies
Oct 1, 2010
I have a macro that creates shapes in my documents. The following macro will delete all of them. How do I modify it so if they say NO it will go through the document and find each occurance of the shape and ask if you want to delete this one? [code]
View 2 Replies
Feb 22, 2012
I am drawin three concentric circles, each with corresponding radial lines from the center to the side of each segment. I want to place text inside each segment and can do so with a horizontal text. I want to ROTATE the text to match the segment's angle and fit perfectly inside the segment, but when I use the Tramsform/Rotate options in VB 2010 the text is rotated but ends up in a unforeseeable place.
View 6 Replies
Apr 26, 2010
I need to get the DataGridView to perform the way it should perform. I'm new to the .NET environment, but I learn fairly quickly. However, I find it difficult to decipher themassive black box of the DataGridView control enough to make it do anything other than what it already does--Draw very slowly.
View 3 Replies
Apr 17, 2011
how do I create a geometric shape as a class? Visual basic has a Rectangle class pre-defined object that I would like to use, but I need to use a rectangle class that can use decimals for the 4 points to set its location. I do not want to draw a shape on the form for graphical reasons but I want to use the shape for an algorithm, how can I create a class for a rectangle using decimals?
View 1 Replies
Mar 3, 2012
I need to dynamically add ovalshapes to a form. The application user would enter a number of shapes (variable), and other parameters for the shapes as location, color,etc. After this I need to display these shapes in the screen. Every sample I found shows a fix number of shape hardcode by the programmer.
View 4 Replies
Jan 4, 2011
Is there anything like shapes control of VB 6.0, in Vb.Net? I need to draw lines etc. at design time. But I could not find any shapes control in the toolbox.
View 2 Replies
Jun 3, 2010
I am writing my code in Visual Basic 2008. I am trying to store the shapes I have added to an Excel sheet in an array and get this error message.[code]...
View 4 Replies
Apr 28, 2012
I am using visual basic 2010 Express as asa windows forms application. How can I make it so people running my application can drag and drop or move shapes or rectangles around on a grid? Please help I have tried different ways but none are working so far.I am making a room/area designer appplication where users can drag funiture/items (shapes) around on a grid.
View 3 Replies
Jun 22, 2010
I need to display various shapes in a picture box, and am trying to do so via a combobox that the user can select from. My problem is clearing a previous selection when a new selection is made.
Code to date is:
Public Class frmGraphics1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Populate cboShape with shapes
cboShape.Items.Add("Select a shape")
[Code] .....
View 2 Replies
Mar 20, 2011
I want to create a Windows form application in VB.NET 2008, and I want to create a circle-shaped window. How can I do it?
View 4 Replies
Mar 8, 2010
I am making a project using the GDI+ interface and have drawn the shapes but I need to move them using the arrow keys. Does anyone know how I would accomplish this?
View 3 Replies
Oct 12, 2009
I am trying to write a program that using a nested do while loop and If/If Else statement to draw a shape, and also using a nested do until and If/ElseIf statement to draw another shape.
View 18 Replies
May 25, 2009
i am creating a winform program using vb where i am loading an image into a picture box. then in the mouse down event i am creating small circles which can act as points which will be displayed on the image. say creating five points around the eye of a bird. then i am having a button by clicking it , a polygon will be drawn on those selected circles x and y as edges. i am having no issues until this. when i am trying to add another polygon in the same picture by clicking around its leg or whatever and pushed the draw button there must be another polygon i.e. two separate polygons 1 on eye and 2 on leg. but there is only one polygon from eye to leg. so my questions are
1) how to close a polygon and draw another one in picture box
2) how to select a previously drawn polygon and delete it.
picturebox_mousedown
Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown
[code].....
View 4 Replies
Mar 14, 2011
Makes the following statement about the code below:
**"The computer evaluates the loop condition in the Do...Loop statment to determine whether the loop instructions should be processed. In this case, the inputsales <> String.Empty condition compares the contenst of the input sales variable to the String.Empty value. As you know the String.Empty value represents a zero length, or empty, string if the inputsales variable is empty, the loop condition evaluates to True and the computer process the loop instructions. *If on the other hand the inputsales variable is not empty, the loop condition evaluates to false and the computer skips over the loop instructions.
Based on the code I think it is the opposite: ...that while the inputsales value is not empty it should evaluate to true and process the loop and if it is empty it should evaluate to false and skip the loop?
See below.
Option Explicit On
Option Strict On
Imports System.Globalization
[CODE]...
View 2 Replies
Aug 25, 2009
The aim of my program is to load a picture into an pic box, then to be able to place multiple shapes on the picture in the pic box by clicking on the location where i want the shape. The type of shape will depend on the radio button which has been selected. Basically all i want is choice of X or O. (its not tic tac toe either At the end of it all i want to be able to save the image WITH the shapes on it, doesnt matter what format its in (gif, jpg, bmp) as long as it has color and i can see the original image with the shapes included.
I have made several attempts at this, and this is what i have so far. (I am brand new to VB and programming so i need all the help i can get) I have hit a wall with how far previous examples can get me.
[Code]...
View 18 Replies
Oct 18, 2009
i have just begun to program so I am a complete beginner. but i cannot find out how to add a shape to my form. I am reading a book that is a guide to beginner programmers but it simply says to use the shape control, but I cannot find that. I am pretty sure that the author was using a different version of visual basic so I just need another way to insert a shape on my form. also, what are the units used in the version 0I am using.
View 8 Replies
Apr 4, 2012
I am trying to put all my rectangleshapes in an array so that it saves writing lots of code of collision for each rectangle. But I get the error "Index was outside the bounds of the array.".
Dim i As Integer
Dim shape(i) As Microsoft.VisualBasic.PowerPacks.RectangleShape
shape(i) = RectangleShape1
shape(i) = RectangleShape2
shape(i) = RectangleShape3
[Code] ......
View 14 Replies
May 26, 2009
I haven't actually mastered VB.NET programming yet but I am already tired of the standard shaped and grey colored controls. Is there no other way (Programs or by code) of designing better looking controls of other shapes like circles or any shape I want and to give cool color and effects just the ones used in Windows Media Player v.11?
View 2 Replies
Apr 16, 2009
I am working on a class that generates a report in Excel (any version).I need to perform a bit of ad-hoc labelling on a chart, for which I have created a textbox (i.e. Excel drawing object).I've managed to get as far as creating the textbox and setting it's text using Shape.TextFrame.Characters.Text. Ideally, I'd like to set the font characteristics as well, but I can't see how to do this. I can't seem to find much info about this anywhere, so hopefully someone's dealt with this before and can give me a few pointers.
View 1 Replies
Oct 25, 2009
I can't seem to find the shape tool in the toolbox? When I used VB6 there was one, so why isn't there one now? I just want to set up rows of circles so I can change the color from inside instead of using images and saying
Code:
YellowCircle.Visible = False
BlueCircle.Visible = True
Instead of doing that I want to do
Code:
Circle.BackColor = Blue
How do I draw a shape in VB.NET? Not during the program, before.
View 3 Replies
Jan 17, 2012
I am trying to do a code for my application that will crop a selected images into oval shape.
I tried to search for a reference on the internet there is only example on how to resize it. But is it possible to crop it into shapes?
View 1 Replies