Resizing A Rectangle Shape In Runtime?
May 6, 2011Resizing a Rectangle shape when the program is running.
View 14 RepliesResizing a Rectangle shape when the program is running.
View 14 RepliesI am creating a simple shape editor, much like the Visual Studio form designer. You can create shapes, select them and move/resize them using drag handles just like in Visual Studio or most other applications (Visio, etc).
I have run into some problems trying to implement a MinimumSize property for the shapes.First of all, this is how I'm resizing the shapes. Each shape has a Resize method, accepting two integers (dx and dy) that represent how much the shape must resize by, and one 'HitStatus', which determines in which direction the resize must take place (for example, from the TopLeft, or Bottom, or BottomRight, etc..)
What it does basically is use a large Select Case statement for the hit status. In each case, it changes the Bounds property of the shape (which determines the location and size), so that it is resized:
[Code]...
I'm using e.graphics in the Me.Paint event to draw a string in the form. There is a rectangle shape with gradient in the form, and the string is supposed to be drawn on top of the rectangle shape. However, when I run the program, the string is drawn under the rectangle shape, and is therefore invisible... How do I fix this?
View 2 Repliesim trying to make a rectangle powerpack shape but i dont know how to get a parent. this is what i have got so far:
snake.Location = New System.Drawing.Point(Math.Round(halfWindowWidth / 10) * 10, Math.Round(halfWindowHeight / 10) * 10)
snake.Size = New System.Drawing.Size(10, 10)
[Code].....
I created a rectangle shape and tried to show it at my form like this
Imports Microsoft.VisualBasic.PowerPacks
Public Class frmBoard
Dim baseDice As RectangleShape
Private Sub frmBoard_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
baseDice.CornerRadius = 5
[Code] .....
I am trying to move a Rectangle Shape using the arrow keys and i have done multiple codes and none of them work. Can anyone help me with the coding.[code]also I am not sure if the code goes in Form1_KeyDown or RectangleShape1_KeyDown
View 1 RepliesI am trying to add shape per user's selection...
if (chosen circle)
use microsoft powerpack ovalshape and all its properties
if (chosen rectangle)
use microsoft powerpack rectangleshape and all its properties
I have installed the Visual Basic PowerPacks V2.0. How do I add this powerpack component to my VB2005 code to use oval or rectangle shape properties?
how I could have an object bounce back when it collides with an rectangle shape. There are multiple rectangle shapes and I don't want to do it all seperately for each one.
View 1 Replieson my winform at runtime i will be resizing my array each time i add an element. so first i must resize to the size + 1, and then add a member to this index. how do i do this?
View 5 RepliesI am working on a contract to repair problems in a application that interfaces with a custom built digitizer tablet.The application recognizes the tablet at startup, initiates calibration to locate the pad limits and then saves those limits to file.During the run of the application the user has a cursor that is changed to a line with a X on the left hand side of it. The user then uses this custom cursor to click in a PDF document where they would like the contents of the Digitizer pad to be placed. When they click a box signifying the size of the digitizer pad along with the same blank and X appears. What I have been having issue with is that the box and the line with the X appear most of the time but on occasion the line and X appears at either the top or bottom of the box and the click is no longer at the line with the X but somewhere in the middle of the box. This really screws up things and often the user has to uninstall and re-install the application to get it righted.
The values that save the calibration points are bound to variables during the build process, there is a separate routine to calibrate the digitizer pad if the user desires to do it again.
Public Structure IconInfo
Public fIcon As Boolean
Public xHotspot As Integer[code]......
I have a code method that I wrote in vb6 that works on every screensize and resolution combo...however vb.net is not letting me do this. Here is what I do. upon form load at program startup I gather all of the data of the controls (height,width,top,left,font
size) prior to the form actually resizing and I store those in a listbox that is not visible. Then when the form resize is called I proportion all of the controls from their old positions versus the new form size.
[Code]...
When I compile my solution and execute the program and set the form in window normal, it behaves strangely. The grip is apparent, the mouse changes to the appropriate icon, but I cannot change the size of the window.
View 2 RepliesI am creating a form in vb.net and i want its size to change the form as soon as the user inputs the desired number of items. In my form I have two combo boxes: one for number of items and the second is for the choices, then when the user choose 5 items 5 text boxes will appear and if the choice is 25 then 25 text boxes will appear. Is there any way that I can change the form based on the input and number of text boxes?
View 1 Repliesi'm attempting to develop a calendar using datagridview where column headers are dates and row headers are list of employees.
i would like to add a button/custom control on the datagridview to represent a task over time where I can move or resize at runtime.
How to draw a rectangle inside an ellipse at runtime?
View 8 RepliesI am creating a Visual basic Editor application. the thing i amnot able toselect the multiple controls at runtime from my application. Is the AdornerWindow supported at runtime to select the multiple controls at runtime ??RegardsVB 8.0VS.
View 1 RepliesThe rectangle is drawn with drawrectangle and the text with drawstring, but the text doesn't fit. Is a runtime adjust possible?
View 2 RepliesI am using Rack-mounted Equipment (US units).VSS as stencil. I need to Connect a server on Rack.
View 1 Repliesi've got a little problem with List(on T) variables.
[code]...
It works perfectly fine. Does anyone know what the problem is?
Given a rectangle of width w and height h. and a coordinate x,y in that rectangle I would like to identify which triangle I am within.
i.e. the function should take parameters(x,y) and return a,b,c,d or a zero based number representing that triangle index i.e. (0=A,1=B,2=C,3=D) if they are in that order.
I think this would be something like >= the formula of the red line and >= the formula of the green line?
I'd like to implement this in VB.NET
This code is to draw rectangle. How can I draw rectangle divided to four rectangle or more
e.Graphics.DrawRectangle(Pens.Coral, 50, 200, 30, 40)
I'M creating a kind of photo viewer, and I cannot figure out how to orient the scroll buttons with the photos I want to draw because they all are different sizes.This is really hard to explain so please ask questions if you don't understand.I'M thinking if i could draw every photo on a single rectangle and then the scroll bars will position that rectangle up or down. but is there a way to make a rectangle inside another one so it only shows inside that rectangle?
View 10 RepliesI have created multiple dropdown list at runtime and populated with data. I also have added an eventhandler to determine the selected value of the drop down list.
The code is as follows :
Dim tbl As New Table()
tbl.EnableViewState = "true"
[code].....
I have a Visual Basic 2005 program which runs fine if I execute the built Executable. However if I start the application in VS2005 debugger it gives a weird error
[Code]...
1-When I click on the ''Square'' radio button I want the shape to appear in the image box, then need I only need 1 text box to appear where the 4 side boxes are, this will be where I enter the value of the sides to calculate the perimeter and I also want the area and perimeter boxes to appear at the bottom since I don''t need the volume text box.
[Code]...
I have a project(solution) which aims to lance a Form from a lancer module. On my Form Design the buttons are nice and round. When I go to Run the solution and the the Form is set as startup project, all is OK but when lancer module is set as startup project all buttons change to hard rectangular shapes and rounded corners dissapear (see attachments).
View 3 RepliesI want to be able to take a flat image and do this with it in my program
[code]...
how do I change the points?
how do I load only PART of an image from abitmap into bbitmap?
is there any way that you could change the shape of a button?
View 3 RepliesI need to change the shape of my tabs... untitled.JPG
View 2 Replieshow to change the shape of the end of the line
I would like to Cap type . Square, as here