Pic Box, Object To Stop Moving
what im trying to do is make it so that i have one bit picture box and a pong design interface inside it(this is a final assignment im making a variation of pong) anywho what im trying to do(and tryed everything i've thought of) is to get it so that when you drag the padel down it cannot pass the line at the top or the bottom, and both these lines are drawn, not made at runtime. thanks for help
also after you hit the line you cannot go down or up further then the line, and you can continue moving inside the two lines
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Stop Txt Moving
can any1 tell me how u stop txt that is in side a pic box moving ever thing u click in the box
Trying To Stop A Form Moving
hi, i am making a program that has docking forms onto the main mdi form. I am trying to make it so that the forms can be docked and undocked. I have so far made a timer that keeps a form in its position all the time but when the user tries to drag the form it flashes and such and then returns to the position wheras i don't want it to move at all, is there any way i can subclass it to stop it moving?
How Do I Make A Shape Stop Moving?
I have a shape(Shape1) that you can move with the arrow keys....how do i make the Shape1 cease to move when a certain event happens, even though the arrow keys are still pressed?
thanks for any help!
ListView - Stop Icons Moving
Hi,
I'm using a listview control in the Icon mode, to display a control panel for my application. The only problem is that when a user clicks an icon, when you move the mouse it moves the icon as well.
Is there any way to stop the user moving the icon?
Stop Maximized Form From Moving
I am using a picturebox as a container to act as a mdiparent because only 1 midparent is allowed when I need 2. When I maximize a "child" form, the title bar is still visible which enable the user to move the max form. I get an error when I set moveable=false during runtime. Is there any way to stop the maxed form from moving? Thanks.
How Do I Stop Flickering In Moving Graphics?
I haven't dealt with graphics in vb before, but I know of a common graphics method to reduce/eliminate flicker in animations called double-buffering.
The flicker is caused from clearing the old frame before drawing the new one. To counter this problem you actually would have 2 picture boxes (or whatever you're using) the first one is the visible one that will display the animation. On the second buffer, you do the calculations for the next frame and place all the objects there, then once the frame is ready for display you change the image on the visible buffer to that of the second buffer.
Since I haven't done this in vb before I'm not to helpful in the code department, but hopefully you'll find this method usefull.
Trying To Stop Moving Past Last Record
I am writing a database with a number of tables with forms atttached to each table. I have placed navigation buttons on each form to move to first, last, next, previous. I have set up the code associated with the buttons as "public sub" so it is available for each form to use.
This was working OK except that when I used the NEXT button at the last record it would open a new blank record & keep opening a new blnak record on each click.
To over overcome this I put in an If statement to check if it had moved to a new record. To do this I used the following:
If Me!NewRecord Then ..... etc
Now I get an error "Invalid use of Me key word" I suspect it is because I am using ME in a public sub
How do I overcome the problem of moving passed the last record and still have the coding available to all forms?
The Code is below.
Thnaks for any help.
Public Sub Next_Record_Click()
On Error GoTo Err_Next_Record_Click
DoCmd.GoToRecord , , acNext
If Me!NewRecord Then
' If new record move back to previous
DoCmd.GoToRecord , , acNext
' Send message
MsgBox "This is the last record", , "No More Records"
End If
Exit_Next_Record_Click:
Exit Sub
Err_Next_Record_Click:
MsgBox Err.Description
Resume Exit_Next_Record_Click
End Sub
Stop User Moving The Chart Around In MsChart
VB6 SP6
I am using MsChart. I need to allow selections but when this is set to True users can click on the chart and move the plot area around the unplotted area.
Anybody know a way to avoid this
Thanks
Stop Item Dragging/moving In ListView
Is there any way you can stop the user from moving the item position in a listview?? I need them to stay the same as i added them first by code, with them being fixed for the user and not allowing any movement of item position!
thanks!
Stop A Moving Image Drawing Over Other Lines...
I have the following code which moves a little image control across the form, but what happens when it moves across slowly is it sort of half draws over lines that I have on the form....how can i get it so that it doesnt draw over the other lines and leaves them intact....so that it doesnt leave this kind of trail.....
VB Code:
Private Sub Timer1_Timer()If Image2.Left < 9240 Then Image2.Left = Image2.Left + 1'only move the picture one space over if it isnt alreadt at the desired locationEnd IfEnd Sub
How To Stop Cursor Keys Moving Focus ?
I am writing a program where an object can be moved round the screen. I first did this using command buttons and then wanted to add the option of using the keyboard cursor keys.
KeyAscii and/or KeyCode worked for most keys but not the cursor keys which didn't seem to generate any events. I got something working using an API call (GetAsyncKeyState).
The bit which still bugs me is that when the user presses the cursor keys, as well as moving the on-screen object, it also moves focus round the various command buttons.
Can anyone suggest how to stop this happening ?
Making A Label Stop Moving When It Hits A Certain Point[solved]
I have a long Label, it shows text, I want it to scroll slowly, but how do I make it stop at a certain point, If I do
VB Code:
Private Sub tmrAbout2_Timer() DoEvents LblAbout.Top = LblAbout.Top - 10 DoEventsIf LblAbout.Top <= 0 Then tmrAbout2.Enabled = FalseEnd Sub
Then it stops when the top of the label hits the top of the form/frame, I want it to scroll through the top of the frame, Its fine if I dont put an If then but it keeps going forever.
Stop Object From Stealing Focus
Hi,
I got a webbrowser.. When he's asking for a username+password for a website, the dialogue got the focus. This is something I don't want to happen!
How can I prefent that the webbrowser steals the focus?
Code:
ShowWindow webbrowser.hwnd, SW_HIDE
does not work.
Code:
webbrowser.silent = true
also doesn't work because then I don't get the username+password dialogue anymore!
Is there a API which tells the webbrowsers: HANDS OFF THE FOCUS!?
tnx!
Stop Code From Moving On If "IF" Statements False [Solved]
hi, i want to verifi the first two boxes before it moves onto the rest of the code so if any of the first two if statements are false it doesnt move onto the rest of the code, any 1 have any ideas?
thx much appreachiated
Private Sub cmdcal_Click()
If cboCars = "" Then MsgBox "Error Msg Here"
If txtdays = "" Then MsgBox "Error Msg Here"
lbltotal = lblPrice * txtdays
lbldeposit = (lbltotal / 100) * 20
lblPay = lbltotal - lbldeposit
End Sub
Moving An Object, Need Help!!!
Hi,
I'm no sure if this is the right place for this but i think it is...
I'm making a small slider control for a Media play I made.. it worksby using 3 picture boxes.. 1 for the background, 1 for the foreground (the actual slider) and one is used to restrict the mouse movements. and i'm having trouble with it..
I got the movement running perfect, but only if the window is maximised, if its not the foreground image ends up in random spots over the screen..
Heres my code for shifting the pforeground picturebox:
Private Type POINTAPI
x As Long
y As Long
End Type
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Dim Pressed As Boolean
Private Sub SliderFore_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
If Pressed = True Then
Dim POINT As POINTAPI
GetCursorPos POINT
SliderFore.Left = POINT.x * Screen.TwipsPerPixelX - 50
End If
End Sub
I used the 'pressed' boolean to ensure the slider doesn't move when the picturebox isn't clicked. I found most of this code in a message forum, and modified it.. If you want the actual code leave me a message with your email and i'll send it to you.....
thanx for your help in advance.
Moving Object HELP !!!!
hey i am making a snake game and whenevermy snake turns i want him to sorta like bend in half and the rest of his body flow along where he moved behind him, i also need to know how to join segments on to him as he eats, how do i do this stuff !?
Thanx
Moving Object
Me Again.
I want a picture box to become visible and move when the space bar is pressed, this is done, however i want the picture box to stop when it hits another picbox or the edge of the form. When either one of these functions occurs i want the picture box to move back to the picture box you control yourself. What i mean is that you are picbox1 and when space is pressed picbox 2 appears and moves, when picbox2 hits picbox 3 or the edge of the form i want it to go back to where picbox 1 is, so you can still move picbox 1 and no matter where picbox 1 is picbox2 will find it and go just infront of it. If you understand what i mean can you please help me.
Here is the code to the entire project as i have it at the moment.
____________________________________________________
Private Sub Picture1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyRight Then
Picture1.Left = Picture1.Left + 50
End If
If KeyCode = vbKeyLeft Then
Picture1.Left = Picture1.Left - 50
End If
If KeyCode = vbKeyUp Then
Picture1.Top = Picture1.Top - 500
End If
If KeyCode = vbKeyDown Then
Picture1.Top = Picture1.Top + 50
End If
If KeyCode = vbKeyReturn Then
Form2.Show
End If
If KeyCode = vbKeySpace Then
Timer1.Enabled = True
Picture2.Visible = True
End If
End Sub
____________________________________________________
Private Sub Picture2_Click()
If KeyCode = vbKeyRight Then
Picture2.Left = Picture2.Left + 50
End If
If KeyCode = vbKeyLeft Then
Picture2.Left = Picture2.Left - 50
End If
If KeyCode = vbKeyUp Then
Picture2.Top = Picture2.Top - 500
End If
If KeyCode = vbKeyDown Then
Picture2.Top = Picture2.Top + 50
End If
End Sub
____________________________________________________
Private Sub Timer1_Timer()
Picture2.Left = Picture2.Left + 350
End Sub
____________________________________________________
Moving An Object.
Y'know how if you press a key on the keyboard, it will place the letter in the text box once, then after a short delay it will start repeatedly placing the letter in the text box? Thought so...
Well I made something that uses the arrow keys to move an object around the form, and I was wondering how I would code it so there is no delay, and it just immediately starts moving right, rather than that stupid delay.
Thanks for your help.
Moving 3d Object In Dx8
Hi. I have the problem. How can i move sam 3d object in the 3d world in Dx8. This object (for example ball, or cube, or box) i made in 3D STudio Max and i convert it in x file format and i open in vb and show it in 3d world. How i can move this object. How can i change his position cordinates (x,y,z). I speak english very bed and i hope so that you under stand me. I needn't keys set up Me need how can i change cordinates (Which command).
Uf. Hi every bady Miskec
Moving Object
I know there are a few threads on things like this, I have seen them befor but I can't seem to find them. It was a few weeks ago that I last saw them.
I have a circle on the form and I want to be able to move it up if I press up arrow down if I press down arrow and so on, if i do this a few time with different things I could learn to move sprites. Any help please?
Need Help Moving Object !!!!
hey i am making a snake game and whenevermy snake turns i want him to sorta like bend in half and the rest of his body flow along where he moved behind him, i also need to know how to join segments on to him as he eats, how do i do this stuff !?
i posted this message before and someone suggested hat i use the following code, however i don't get what each variable represents and what objects are they on the form if ya know what i mean so i can apply it to my code !?
' a point
Public Type Point
X As Integer
Y As Integer
End Type
' the snake
Dim Snake() As Point
Dim SnakeSize As Integer
Public Sub GameStarts()
ReDim Snake(InitialSize)
SnakeSize = InitialSize
' fill initial positions
End Sub
Public Sub GameIsPlaying()
Dim i As Integer
Dim Tail As Point
Tail = Snake(SnakeSize)
Snake(0) = NewPositionForHead
For i = LBound(Snake) + 1 To UBound(Snake)
Snake(i) = Snake(i-1)
Next i
If EatenAnApple Then
SnakeSize = SnakeSize + 1
ReDim Preserve Snake(SnakeSize)
Snake(SnakeSize) = Tail
End If
' draw the snake in the positions
End Sub
Thanx
Moving An Object
Ok I must be going crazy today something that should be simple is kicking my butt.
I'm trying to set up the code to drag an image around using the mouse this is my code
Code:
Private Sub picImage_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
mDown = True
mStartX = x
mStartY = y
Debug.Print Button
End Sub
Private Sub picImage_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
If mDown Then
picImage.Left = picImage.Left - ((mStartX - x) * Screen.TwipsPerPixelX)
picImage.Top = picImage.Top - ((mStartY - y) * Screen.TwipsPerPixelY)
mStartX = x
mStartY = y
End If
End Sub
Private Sub picImage_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
mDown = False
End Sub
Why dosn't this work correctly? It's acting totally insane, if I take out the multiply by the screen.twips* then it works fine but at a very slow pace. I want it to keep pace with the mouse (thus why I was multiplying by the screen twips)
Moving An Object
u guys know when u throw a ball it bounces n when u throw it u go somewhere...well how do i make it so if some happens then lets say a circle is then moving from one spot to another without the .top = .top +100 or something like that
Moving An Object Questions
Ok I am making a game for a project that I have to do and I am having some difficulties the following are a few questions
1. The game consists of a snake that you move, I am trying to figure out how I can make another object dissapear when it collide into it that then re-appears randomly on the screen.
2. I want a segment to be added on to the snake each time it collides into this object and I want this segment to turn with the snake whenever the snake turns.
If anyone can help me out here I would really appreciate it !!!!
*Thanx*
Moving Object By Mouse!
Ok I have a bit of Newbie problem..(I quess)
I have a form with a (small) pictbox control and like it to move around the form when/where ever I move the mouse. I don't want to drag en drop I don't even want to "click" first before moving. Now I sort of have this working for one small detail. As an object is basicly moved by changing its Left and top posision to x and y there doesn't seem to be a way of moving it by its midpoint possision or in otherwords the center of the object (pictbox) doesn't seem to be stucked to the mouse. So my pictbox only moves when I put my mouse pointer to the left border of the pictbox, the movement is then fine, but when I move to the right, the pictbox doesn't move before I "hit" the right border and then it doesn't move but sort of jumps to the "new" left posision.
making the movement not very smoothly..the same happens up and down! (up works better than down)
So I actually only sort of want to stick my mouse pointer to the center of the pictbox and then move it (maybe I should just use a piece of tape uh..)
Moving An Object Away From The Screen
say i want to move an object farther away from the screen, like going into the distance, right now i got a cube with a black screen and i want it to move back, right now i changed the the z corodinates but it stays the same. should i change all the corodinates for every vertex, or just move the camera away from the object to make it seem like its moving farther away?
Moving An Object On Excel
this is probably pretty basic but im pretty new to vb. how can i move a box concealing a number in one cell to the cell next to it, revealing the number beneath it. it is for a game i'm developing, thanx
Moving Object Across Form
I am making my own version of MDX Studio (MDX Studio being a program that designs an mdx dialog for mIRC) and I need to be able to move an object (ie. drag it), but I can't seem to figure out how.. All I need to start is a way to drag a picturebox, and when it is released I want the box to move to the X,Y position.. Any suggestions?
Moving An Object Via Keypress
Hello guys, i just wanna know what are the keycodes for the cursor keys? I want to use it in a program wherein i can move an object / shape via a keypress method... Thank you very much!!!!
Moving An Object Over A Tile Map
Hi
I have a simple tile map of 6 by 6 picture boxes set in an array with a grass tile in each pic box. I also have a separate picture box that is not part of the tile. I want to make it so when I click the separate pic box, the border style changes(i already did that) and when I right click somewhere else on the tile map, the separate pic box will move there in a straight line. If I were to do this on my own, I would get the xy coords of the upper right separate pic box relative to the tile it is on. Then I would get the xy coords of the different tile I clicked on and move the pic box there... but how do I go about doing this???????????????????????
Thanks in advance
Moving Object By A Centimeter...
Hi,
I have an mage in an image box and when I click a button on my form I want the image box to move in a direction by 1 centimeter, e.g.
Image1.Top = Image1.Top - 1
Whereas '1' is a centimeter instead of just the standard unit.
Any info on how I can do this?
Mark
Browser Helper Object (BHO), User Hits Stop/ESC.
I'm trying to decipher how to tell when the User hits Stop or presses the ESC key during a page load, as my BHO isn't supposed to do any work on the document that has been stopped. It's currently operating now, mainly for testing purposes, but currently, it keeps doing it's work even if I stop the loading of a page (which makes no sense, if you want to close the window).
I've looked at the browser's ReadyState and it says it's complete (even with the document loading stopped). Since VB doesn't impliment the IDispatch, does anyone know if I could gain access to that, to find out if the user did indeed cancel the page load? I thought of looking at the document for a qualifying </HTML>, but some page authors are either lazy or don't even add one, thus I cannot rely on that as a means to ensure the user did stop the page load.
FM.
Create Trail For Moving Object
hey everybody. Im looking for help on a prject of mine. I have made a graphics display program that has a skull bouncing around. What I would like to do is to creae a trail of flames behind him, but could somebody help me on how to do this. It is very puzzling to me. Any help would be much appreciated!
Moving Text Around On A PictureBox Object?
I am wanting to move text from one position in a "PictureBox" to another by seemingly clicking and dragging and having the text appear to be moving along with the mouse pointer.
The text is introduced by the "PictureBox.Print" method. I have tried using the "vbInvert" with the "PictureBox" "DrawMethod" as you would do with lines and circles on the mouse move event, but this doesn't seem to work with fonts as I get a trail of text all over the screen!
At the moment I have worked around this by using a rectangle that represents the boundary of the text in question which is functional but I would like to advance this is possible.
Does anyone have a solution for this?
Thanks in advance, CrazySchmidt.
Collision Detection Moving Object?
Ok im too sure how to explain this but for mt Collision Detection in my
first game im making i need a Line control to move with a Image Control.
But i dont know how seen as it doesnt have .left .top and stuff so
how can i move a Line Control across a form
Problem With Moving Object Interaction
Hi. I hope someone can help me with this (probably physics-related)
problem. Imagine two seperate objects which can create forces (all
angles) to move around.
For example:
this is one object: o
^
|
o o ->
(force to the top) (force to the left)
Now imagine an unflexible connection between those objects. How can I
program these interaction between the two objects (and maybe more
objects later on) ?
For example:
o ->
|
| this combination would cause an circular motion
<- o
o ->
|
| this one would make them move to the right equally
o ->
^
|
o
|
| this would make the construct stand still
o
|
v
In these examples I assumed that both objects have equal masses and
forces.
Thanks for any help.
Regards,
Jan
I Need A Few Tutorials {object Moving/scrolling}
I know the answers to my questions are here somewhere, but I don't exactly have the time to search a whole forum for them. So I am going to ask them here.
I would like a tutorial for making an object jump, I have seen one, but it was quite confusing.. Is there a better one?
I would also like a tutorial for making the tile move when you move an object off the form. Side scrolling game kind of.
Any help would be greatly appreciated. Thanks.
Moving 1 .x Object, Not The Entire Scene
Hello,
i have an application that loads a number of .x files. using the world matrix i can move all the objects at once, but i cannot move just 1 object.
i searched this forum and found a thread "Moving / rotating a model in Direct3D " but no actual code samples existing. I posted a message in the thread, and sent private messages. but i have not received any information back.
so if anyone can please show actual code that moves 1 ,x object, not all the .x objects, please post it here.
thanks,
scot
Moving An Object With Timer QUESTION!
i can't figure it out... i know its really easy too, can someone tell me the code? to make an object move down... something like image1.top + 1 or something.
Moving OLE Object From ACCESS To WORD
Hi there,
I have an ACCESS 97 table which contains text fields and a field of type OLE Object which contains a bitmap image.
I am trying to populate a Word Document with the contents of the database record and have become stuck with the OLE object field.
The Word document contains a table and I have created bookmarks to enable me to the reference various points in it to insert text etc.
The code to move the text from ACCESS to word is along the following lines...
myObj references the Word document
With myObj
.ActiveDocument.Bookmarks("text_field1").Select
.selected.text = Forms!mydbForm.txtTextField
I believe I could use AddPicture or inlineshapes to add an image from an external file, but I would like to know how to add the image to the Word document directly from ACCESS and what the required syntax would be.
Thanks,
Smorty.
Moving Object With Timer, QUESTION
i can't figure it out... i know its really easy too, can someone tell me the code? to make an object move down... something like image1.top + 1 or something.
VB6 Help With Firing/Shooting At A Moving Object.
I'm trying to create a simple game where an object (command box controlled by you) 'fires' another object (shape, ex. a bullet) at a target that's moving. *you can also move.* I want it to trigger on a KeyDown event; a hotkey. My idea is, press the button, the shape aligns to you (left,top) then finds the angle at which the target was at (its left,top coordinates) when the key was pressed and 'fires' until it collides with either the target or form if the target 'dodged' it.
I have no problem with collision and alignment so don't reply with information about them, please.
I just need help establishing the angle in which the shape/bullet follows, and having it follow it. I'm thinking, use two variables for the X,Y distances something like
Code:
xdis = abs(bullet.left-target.left)
and the correspondent for Y. Then using those two distances and the right angle along with tan-1 (something else I need help with) to find the angle the bullet fires along.
Please help, and if clarification or more information is needed just ask/reply.
Moving Object At Runtime In VB5 *Solved*
hello you all
I am trying to program a designer and i need to be able to drag a textbox around the form, like moving objects around with my mouse. I'm stuck on this since 2 days so far! S.O.S!!! Help! à l'aide!
If any1 has an idea, it would be great to hear! :-)
Thanks alot
Me
How To PREVENT Mouse From Moving Over An Object??
Hey there all,
If anyone knows a way to prevent the user from moving the mouse pointer over an object on a form (like a textbox, listview, etc.), it'd really help me if they posted an example.
Thanks, no matter the result,
Jason
Important - Moving An Object Clockwise
Hi all,
I know its touch..but i need it.
I have an image object, which is an icon sized image. I need to move it in a circular path without any disturbance. Can anyone suggest me or with some codes?
Anything would be of great help to me.
Keeping A Moving Object On Form
I am trying to make a space game that i guess is similar to space invaders, and I have encountered a small issue.
When you hold down the left and right key it will move the ship in the specified direction, but it will travel off the form if you hold if for to long, how can i keep it form travelling off the form?
this is what i currently have.
Code:Private Const MoveAmt = 120 ' Amount to move the space ship each press of the button.
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyLeft: GfxShipf.Left = GfxShipf.Left - MoveAmt ' Move the space ship left.
Case vbKeyRight: GfxShipf.Left = GfxShipf.Left + MoveAmt ' Move the space ship right.
Case vbKeySpace 'Reset Space Ship to the center
GfxShipf.Left = 3000
End Select
End Sub
Freely Moving Object By Mouse Movement
IS anybody know How can i rotate my object by mousemove?i had wrote code and it is working but after 180 degree it will rotote with reverse order.and i am not able to find where i have made mistake??
is anybody want ples. help me out.
|