473,809 Members | 2,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

motion of controls

1 New Member
i have a form whit a picturebox and some buttons to move the picturebox.i dont want the user to guide the picturebox out of the form even by dragging the form border picturebox moves just in the form border, and also there is a button to guide the picturebox to the start position(start choose by user).what can i do?
Apr 8 '12 #1
1 1746
RhysW
70 New Member
set up some integer values of largest x value allowed, largest y allowed, smallest x allowed and smallest y allowed, when you move the picture make it run a check that the new coordinates arent exceeding these values, if they are then dont allow the movement

important note, the pictureboxes coordinates are considered to be its top left point so when figuring out how far right or down it should be allowed to go remember to factor in the length of the picture box itself, otherwise the picture can go outside the area visually, but logically its top corner is still within range.

hope this helps!
Apr 13 '12 #2

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

Similar topics

2
3995
by: User10 | last post by:
Can some one provide an algorithm for motion detection between two jpeg frames? Or can you provide a more appropriate group to post this on? Thanks!
0
890
by: Mamatha | last post by:
HI, I have an application in C#.NET,to capture a video and save it as a wmv file at the same time i want to do motion detection on that same video. I downloaded one motion detection application from net and integrate that application into my original application. My orginal application uses one method to display video and motion detection application code uses another method to display video into control,this is uses COM componenet. If...
0
993
by: sekhar_ps | last post by:
can any one tell me how to decode motion vectors at the time of decoding,can any one please provide code for that or provide algotithm,and how would represent motion information for each macroblock?
1
1469
by: Cylix | last post by:
Should we discuss about the motion of a layer move, I think it is a common technique on many sites. The technique seems using setTimeout and increment the postion value of the layer. Should we discuss and group any article here about how to perform this animation better? What I mean is, we should NOT set the timeout to 1minisecond for make the motion flurent, I think it is too large effort for the client
7
1731
by: libsfan01 | last post by:
hi guys is there an extension for scriptaculous (or another library) that allows you to create more organic/natural looking movement? for example when an image slides across the screen, it does at a variable speed, increasing at first then decreasing at the end. I feel it would need to be able to do this before it can become a viable substitute for flash, which i would love to see!
1
2600
by: untitled | last post by:
i wrote an application in c++ that capture a motion from a bmp sequence and outputs a 3DS max secript file contains the motions keys. i have two points here need to be fixed: 1- it is an offline application, ie. you take a movie file, convert it to a sequence of 16color BMPs with adobe premiere for example. to imporve, we should let it read the video stream directly from a webcam for example and detect motion directly from it. the...
8
3210
by: David24 | last post by:
source code: <link removed> comcast wont allow .rar (because they suck) so you have to right-click save page as and rename to .rar. i tested this twice and it works fine. this motion detector has 2 filters, edges and rectangles. this is concerning the edges filter only, it compares two bitmaps (converted to grayscale), gets a list of x and y coordinates, and draws tiny rectangles at each coordinate which represent the difference between the...
1
2024
by: valy | last post by:
hi guys, do y'all have any idea about writing a function to calculate the amount of white pixels on a difference image, and if the white amount is >= the threshold value then the image is count as a real motion to avoid some small motion detected which is not a real motion. Finally an motion alarm feature is applied. C code in Linux are required. hope someone can help me on this. thanks alot.
1
7441
joedeene
by: joedeene | last post by:
Hello all, I am using Macromedia Flash Professional 8 in this example of a simple way to use motion tweens. Ok here goes... Directions: A. Preparation 1.) Start the Flash program. Once loaded, create a new Flash Document. Note: By default the pixels are set to 550 x 400, i changed mine to 275 x 200. 2.) Speed up the animation by changing the frame rate to 36 fps.
0
9721
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9603
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10640
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10120
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9200
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5689
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.