English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Basicaly i want a picture (or image but preferably picture) to move up and down when i click and drag it but only up and down does anyone know how to do even the first bit? if so please tell.

now number two how do I get a picture (or image) do move up and down using just keys? again if any one knows please enlighten me

2007-12-01 10:10:58 · 2 answers · asked by Anonymous in Computers & Internet Programming & Design

2 answers

Key presses can be intercepted by the key press event. The form has a keypreview property which must be set to true. When this is set true the forms keypress event will fire along with the specific controls key press event

However the arrow keys donot appear as ascii code and donot fire the keypress event. Arrow keys fire the key down event and have keyCodes 38 = up, 40 = down

For click and drag you can use the mouse down and mouse up events to obtain X & Y coordinates of the mouse on the form. You can determine the difference between the Y down and Y up values and move the picture accordingly using the .Top property

You can use other event such as mouse move which fires as the mouse moves over it. merly put a boolean value which is set and reset in the mouse up and mouse down events to act as a permissive in the mouse move event.

You will find that you will have to add code to account for the different in locations from the mouse position relative to the top position of the control. This will be a good opportunity to learn details about the coordinate system of the form and how thet top and left porperties of teh controls relate to mouse position.

2007-12-01 13:44:47 · answer #1 · answered by MarkG 7 · 0 0

uncertain its customarily utilized in growing to be macros in excel, employers are looking greater at languages like C# because it fairly is shape is strict, in different phrases each assertion would desire to end in a semicolon or the app wont run, while seen simple you are able to omit it and the app might nonetheless run. additionally it relies upon what variety of programming you're going into, for video games and OS's C++ and python are greater probable to help you out. Java is great for documents superhighway and cellular purposes, because it is pass gadget nicely matched it fairly is as long as you will get the runtime on the gadget the app will artwork. As such it fairly is utilized in telephones, i-(pads, pods, telephones), etc.

2016-09-30 09:48:18 · answer #2 · answered by ? 4 · 0 0

fedest.com, questions and answers