How To Move Rectangle In Program
May 14, 2011I am raw hand. I want a simple function, when I press a button, I change a Rectangle position and size. so the code is:
[Code]...
I am raw hand. I want a simple function, when I press a button, I change a Rectangle position and size. so the code is:
[Code]...
I have a canvas in the middle of my application with controls around it. I have a socket that recieves Points and saves them in a list.
I draw small 4x4 rectangles on the canvas for the number of points in my list.. say theres 4 points.. theres 4 rectangles.
I want to be able to move the rectangles when the points change with code.
is this possible without storyboards or any 'animation' class?
I have tried:
'cMap.Children.Remove(r)
'Dim nr As Rectangle = New Rectangle() With {.Width = 4, .Height = 4, .Name = "r" & P.Name, .Fill = Brushes.Red}
[Code].....
I am doing windows application in vb.net, now I want to move the rectangle using key event.
View 12 RepliesI want to Draw an Rectangle on a PictureBox and after that I must be able to move this Rectangle around. I have made now that I can draw a Rectangle on a Picturebox via MouseDown and MouseMove Events, but I dont know how to Move the Rectangle.
Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown
Try
If e.Button = MouseButtons.Left Then
cropX = e.X
cropY = e.Y
[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 using vb6.0.I want to load a image into a picture box and resize it in runtime through mouse.Image type is jpg or png.my logic is,
1. load image[jpg or png ] into picture box and draw a rectangle using rectangle API, according to image size.
2. resize rectangle through mouse and according to the size of rectangle change size of image.
Dim car As Graphics
x = 50
y = 100
'Dim myBrush As SolidBrush = New SolidBrush(myColor)
[code]....
I would like to move the rectangle to the right by 1 pixel each time the timer1_tick is started. At the same time, I would like to clear out the previous boxes after making a new one. This is to make the box looks as if it is moving to the right.
How to draw a rectangle inside an ellipse by mouse events like mousedown,up,move
View 2 Repliesi've got a little problem with List(on T) variables.
[code]...
It works perfectly fine. Does anyone know what the problem is?
I can't seem to make a GUI in the shape a circle...
something other than square/rectangle.
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
I'm currently working on a screenshot program, much like Gyazo and I've come across a problem.
[code]...
Now, it draws perfectly when I drag left to down (vice versa), but when I try and drag the opposite way (this is when I get negative x and y values), it doesn't seem to draw the rectangle.I've tried fixing it but with no luck at all, it just messes it up :c
im trying to make a a rogram that will calculate the area of a rectangle based on the lenght and
width given by the user
[code...]
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 RepliesThis is simple program, draws a rectangle, marks the x & y axis, & plots a dashed line grid. However, the grid sub has to be called twice - only then will the grid line be visible. Why does this happen?
CODE:
I have a few questions about using the Mouse in a VB program
1. How would I get my program to move my mouse to a color thats anywhere on the screen? I want this done by hotkeys.Example: Lets say the hotkey i want to use is ALT+C and the color is white. When I press ALT+C, it will move to white.
2. How would I simulate a mouse click when the mouse is over a certain color? Again, I would like this done with a hotkey.Example: Lets say Hotkey is ALT+D, and the color again, is white. When I press ALT+D,I want my mouse to start clicking whenever its goes above white. I also want to be able to turn this off. I want to be able to set the "click interval"
3. How would I "move my mouse" downward when I press a HotKey and Click?Example: Lets say my hotkey is ALT+V.I press ALT+V. Then whenever I click my mouse, the mouse cursor will "move" a bit down.I want these to work even when my form isnt in focus.
I want cut and paste these files as chunk of 100 in 5 diferent folders
e.g 100 for folder1, 10 for folder2 and so.. on
how to cut and paste 100 files in one to to a diffrent folder
i want to move a program that already is running, and by move, i mean change the x and y coordinates of the application on the screen. how would i go about doing this?
View 4 Repliesi want to create program that rec mouse move and clicks.This is my code and when i debug my program without clicking she recs a lot of right and left clicks
[Code]...
Normally you would move a program around by dragging the bar at the top of the window, agreed? How can you change a form in VB to move around when dragging anywhere on the form apart from a button?
View 17 RepliesI am using vb.net,is it possible to change the size or place of a button at run time.I meant we can click and drag the button to increase the size or move?
View 2 RepliesI need do move the file from one App in root/ProgramFiles to another app in program files. It happens thta in Vista/Win7 I can nod do this... And wehn i try to do this im getting frllowin exception: "Access to the path is denied"
this brings me to the question: How can I write move files to the directoris that are other then MyDocuments? For me this is critical as I need to move custom library to existing app if it is not found there, otherwise my app will not work :
How can I move the mouse to a pixel location of a program?[code]I know it doesn't work, but I'm trying to make it easier to understand what I'm trying to do.
View 5 RepliesI have some items in a listbox and a try catch. I need it where if the program catches an error with the current listbox item to move on to the next one.
View 18 RepliesUsing arrow keys to move a shape also changes the value of trackbars elsewhere in the program?
View 7 RepliesI am creating a bulk media converter. In order to do this I need to go through each line in a list box one after the other and run the conversion function. I am trying to use the following:
For Each item In listVideos.Items
conversion code
Next
However this makes the program want to convert all videos at the same time... is there anyway to get the program to convert one video and then after the conversion code is completed to move to the next one?Should also be noted that I am using FFMPEG for this project.
how can i either copy/move/rename & delete a file in program files directory? [c ode]i already have the form which grabs the updated file and it save it to temp directory ready for copying, just stuck here as of the access denied.
View 4 Replieshow do i copy and move the entier contents of a directory to another ussing VB.net then also delete the files from there original directory?
View 1 RepliesI have three listboxes in an array and on form_load the listboxes initially select the fifth item in each listbox:
Private Sub frmSample_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
For i As Integer = 1 To 3