Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Label In A Moving Image


is there any way to put a label or text inside a moving image so it contains some text in the center even when moving? This text will randomly changes everytime a certain event triggers

or I have to use the frame thing??




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Moving Label
Just out of pure wonder, I would like to know how to make a Label, follow the mouse movement on a form. So, when I move the mouse, the label stays right with it... Any ideas? Thanks!

Moving A Label
Hi all,
I have a little problem, I have a line of code:

lblblank.Move lblblank.Left + 130

Now this line of code enables a blank label to move across to the right of the screen. What i need to know now is how to stop this label moving across the screen after it has moved a few times to the right.
Does anyone know the line/s of code that come afterwards, i'm a bit of a novice so i'm not sure how to do this.

Any suggestions? cus i'm desperate.
Love Sweetpea

Label Moving
What is the difference between these...


Code:
Label1.Move 111,222


and


Code:
Label1.Top=222
Label1.Left=111



I am just wondering why the writers of VB6 felt the need to make the special call 'Move' for labels?

Moving A Label
how can you make a label to move around during the form is open?

Moving A Form With A Label [VB6]
Okay so I don't like how the Windows title bar looks. SO I wanna make my own out of a coloured label.

How would I make it so mousedown on label + drag = form moves?

I got this:

Code:
Private Sub Label1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
FormMove Me
End Sub


But I get errors. What do I do :P

Moving Label With Graph
i have a shape thats a bar graph..i also have a label..i want the label to be at the end of the bar graph everytime i click the command button and the value changes..how could i do that? basically the label follows the shape. help please, thank you very much

Im Back . I Have A Moving Label.
I have this label i want to use as a moving staus bar. nut it flickers too much how can i change that. Can i use a paint or print function faster to print the status on top of the form and then erase it then print it again like a 100 pixels away ? Posted it my example.

OK One More Making A Moving Label
Can you please help me make a label that will move back and forth the length of the form. It would go to one side then bounce back and go to the other. I cant seem to get it running properly.

Thank you

Moving A Form With A Label
Good day kind sir or madam,

how do i make it so when i click on and drag a label, it drags the form with it, just like clicking on and dragging the title bar?

Thank you kindly kind sir or madam.

Moving Label Continuously
Hi Folks,

I wrote an a simple example for moving label left to right using timer control. but i am not able to do it Continuously repeat.anybody tell me how to repeat label.

Thanks

The code :


Private Sub Timer2_Timer()
Dim i As Integer
For i = 1 To 10
Label1.Left = Label1.Left - 20
Next i

For i = 0 To 10
Label2.Top = Label2.Top - 20
Next i

End Sub

Moving A Label To Another Picture Box
I have a label array, a textbox array and a picture box array.
the labels and textboxes are generally loaded on Picture(0).

I need to be able to load them on another Picture box.
I am able to do this with the textboxes using their hWnd.

Code:Public Declare Function SetParent Lib "user32" _
    (ByVal hWndChild As Long, _
    ByVal hWndNewParent As Long) As Long



So I load them and then I move them to te appropriate Picture box.
But labels don't have an hWnd. So I cant use that function.

Anyone who knows how I can move a label between Picture boxes?



Edited by - beki on 3/25/2004 12:49:11 AM

Moving Label (for Lack Of A Better Term)
Ok. First off, I have no idea how to do what I'm about to ask, and my vocabulary is gonna be pretty shaky. Ok, here it goes.

I'm making a game that relies tons on user input which provides data for output. I want the output to be put in labels, adding on to what was previously written. So say player1 does 7, 9, 4, 6, and 11 damage over 5 turns, and player2 does 5, 7, 2, 17, and 5 damage over 5 turns, I want a label to read.

player1 does 7 damage
player2 does 5 damage
player1 does 9 damage
player2 does 7 damage
player1 does 4 damage
player2 does 2 damage
player1 does 6 damage
player2 does 17 damage
player1 does 11 damage
player2 does 5 damage

I also don't want the label to be massive, so I want to add a vertical scroll linked to the label which will remain all the way down until the user moves it up to view what happened (it will show what just happened, but if the user wants to view what happened many turns ago, they can move the scroll bar up to see it.)

If anyone so much as understands this and can help me, plz do.

Learn To Read/ Moving Label
Hi Everybody, i want to create a program that will assist my son in getting interested in reading.
a label moving across the text in a story highlighting the words as it passes over and then moving to the next line and continue until the story ends

appreciate any help in this regard

thanks
Brian

Select Case Help For Moving Label
Hi all,

I'm making a pong game currently, and so far i've got music playing on it, i've got the paddles moving correctly, and I have the ball moving correctly and bouncing back when it hits the paddle. Problem is that when I move the paddle out of the way from the ball it will hit an invisible wall (which is the paddle.left) and bounce back. I can't figure out how to fix this here is my code in the timer:


VB Code:
Private Sub tmrBall_Timer()    Select Case iCase        Case 1            ball.Move ball.Left + 100, ball.Top            If ball.Left + ball.Width >= lblPaddle2.Left Then iCase = 2        Case 2            ball.Move ball.Left - 100, ball.Top            If ball.Left + ball.Width <= lblPaddle1.Left + lblPaddle1.Width Then iCase = 1    End Select    End Sub

Moving Or Resizing Label During Runtime
I need to move and resize a label during runtime of my aplication. I am able to move all other components during runtime except the label. can anyone help me in this regard as soon as poosible.i really need it urgently.

Any kind of help is appreciable.

Moving A Form Using A Label Or Picture Box
How can i go about moving a form but i dont want a title bar i want to move it from a label or picturebox

ADDED *** IM ON VB6

Label Arrays.......Moving Text?
Just wondering if its possible to move text from an array of labels
to another array of labels in a certain order.?
for example, this is what i somehow want to do:

Label1(0).Caption = Label2(0).Caption
but when i try to put this line in as well:
Label1(1).Caption = Label2(0).Caption
only the 2nd line works, does this make sense, and if so how do i do it properly?

Moving Info From Label To A New Form
I have a multi form app and i need to move the total the first form to a new form.
How do i do this in vb6. I have tried using clipboard but cant get that to work and i think there is a better way than this.
I would be greatfull for any help.
Thanks Brian

Moving Info From Label To New Form
I have a multi form app and i need to move the total the first form to a new form.
How do i do this in vb6. I have tried using clipboard but cant get that to work and i think there is a better way than this.
I would be greatfull for any help.
Thanks Brian

Moving A Label In Front Of A PicBox
Every time i add a new PicBox a run time, and then add a new label, the label always draws itself underneath the picbox, so it cant be seen. Is there a way to move the label to the front of the picBox?

For some reason the "Bring To Front" and "Send To Back" commands dont seem to work

thnx

Moving An Image To Move Another Image
Im creating my first small program for my assignment and ive done the design and code, just havign trouble with another part if anyone could help me please.

Here is my whole code first off.


Code:
Option Explicit

Private Sub cmdBat_Click()

While imgBall.Left < imgBatter.Left
'Moves the ball away from the bowler
imgBall.Left = imgBall.Left + 1
'Comment
DoEvents
Wend
'Comment
While imgBall.Left < imgBatter.Left
'Comment
imgBall.Top = imgBall.Top - 1
'Comment
imgBall.Left = imgBall.Left
' Allows the user to respond to another button
DoEvents
Wend
End Sub

Private Sub cmdBowl_Click()

While imgBall.Left < imgBowler.Left
' Moves the ball towards the batter
imgBall.Left = imgBall.Left - 1
' Allows the user to respond to another button
DoEvents
Wend
'Comment
While imgBall.Left < imgBowler.Left
'Comment
imgBall.Top = imgBall.Top + 1
'Comment
imgBall.Left = imgBall.Left
'Comment
DoEvents
Wend

End Sub

Private Sub cmdExit_Click()
End
End Sub

Private Sub cmdStart_Click()
imgBowler.Left = 8400
imgBowler.Top = 960
imgBatter.Left = 840
imgBatter.Top = 960
imgBall.Left = 7920
imgBall.Top = 2520
End Sub
What i need to do, as the ball gets to the bat for the bat to hit the ball and move it back where it came from. Ive done so far that the ball goes past the batter and when the bat button is pressed the ball comes back to the bat and goes back again.

I cant work out how to move the ball back when the ball is moving and the button is pressed. Im not advanced in programing either, ive been doing it for about a year

Here is an EXE of the program so far to demonstate
<link removed>

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.

Data Type Conversion Error When Moving A Date From A Label To A Database
I am getting a data conversion error when i am moving a date from a label to a new db when the field is a date format do you guys have any ideas? thanks

Image Moving
vb6.0
Hi,

id like to know how to move a picture inside an picture box without moving the box but only the picture inside it. like, i have a 2000x2000 picture in a 400x400 picture box and wat i want is for it to show inside it and then i move the picture to see differ parts of it while the picture box remains in the same place.


Thank you.

Seeing The Image While Moving It
How to move an Image (or a PictureBox) over a Form and see the image, not only its surrounding frame, during the move phase. Basically, my code looks as follows:

[vbtemp]
Private Xi As Single
Private Yi As Single

Private Sub Card_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
Card(Index).Drag vbBeginDrag
Xi = X
Yi = Y
End If
End Sub

Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
Source.Move X - Xi, Y - Yi
End Sub

Private Sub Card_DragDrop(Index As Integer, Source As Control, X As Single, Y As Single)
Source.Move Source.Left + X - Xi, Source.Top + Y - Yi
End Sub
[/vbtemp]

The 'Card' is an Image (or a PictureBox) located in a control array. The code works fine, but I can't see the card face while I'm moving it.

Moving An Image
I tried borrowing the code from ?????'s pacman example

Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
'figure out where we WANT to go....
Select Case KeyCode
Case vbKeyLeft:
ShpTestShooter.Move -350
Case vbKeyRight:
ShpTestShooter.Move 350
End Select
End Sub


Private Sub Form_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case vbKeyLeft:
ShpTestShooter.Move -350
Case vbKeyRight:
ShpTestShooter.Move 350
End Select
End Sub

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyLeft:
ShpTestShooter.Left = ShpTestShooter.Left - 350
Case vbKeyRight:
ShpTestShooter.Left = ShpTestShooter.Left + 350
End Select
End Sub

arrrrggggh!!
how did he managed to get his pacman working???
My program refused to respond to my pressed keys
which are arrow buttonws
Put a breakline, it absolutely refused to go there

Image Moving
How can you get a picture box or an image to move across the screen. I'm guessing you can use a timer, but am not quite sure how to set up the timer. What I have is... a for next loop in a sub called PlaneMove (I call that sub in GameLoop). So, in this sub, I set the image.visible = true, and then the for next loop is
For i = 1 to MAXPLANEX (MAXPLANEX is the end of the form to the right)
Picture.move i, Y (Y is an int(Rnd) formula to make the y coordinate a random number)
Image.move i, 0 (I don't know why, but I can't get the picture box to move across the screen without an image moving across the screen also, but if I just have an image it jitters, and has problems.)
Next i

So anyway, the result of the for next loop is that it works, the Picture Box of an image of a plane moves across the screen very smoothly, but there is one problem. The whole loop has to go through before any other action can be done, and in this case in this game, Player 1 is a tank that has to shoot the plane, and it should be able to move left and right, and up and down, with the max y coordinate set at an integer so that it can't pass that integer. The problem is, the plane has to move through the entire screen, and only after it passes, will the tank move to the cursor position, and Player 1 can't shoot at all, because as soon as the plane goes through the loop and gets to the end of the screen, and once the new tank picture is drawn at the tank coordinates, the planeloop starts again, and therefore there is no time for the ball to shoot out and move. I'm guessing that with a timer, the plane can move through the screen, and Player 1 can do all of the other actions without any problem, but I just can't figure out an algorythm for the timer, so I'm just basically stuck in an everlasting loop... both in the game and in the code... any suggestions?

Moving A Image
here is my code:

Private Sub Timer1_Timer()
imgshield.Move Left - 100, Top + 1000
End Sub

i've placed my code in the timer and form coding areas but it still won't work... why won't it... I want it to move constantly I.E.: like this simple little "."

I want it to go like this:
. . . . . . . .

I want it to be constantly moving until I tell it to stop

P.S. my interval's set at 1000

Moving Image
anyone have a code snipplet for that I could place in a timer to make an image move (right to left) accross my form? thanks in advance!

Moving Image (gif)
How can I add a moving gif on my form?
when I do it with a picture box or image it wont won't move.
can anyone tell me how I can do this?


//golles

Moving An Image
Is there a way where I can drag an image anywhere i want on a forum and when i let go the image will stay there?

Moving Image
I want to devolop

a project in which i want to gif images they are moving means animated
but when i put them on label or imge control
they become constant means not moving how can i use the please give some
sugestion
Thanks

Moving A Image
How can i move an image left and right???I would imagine its simple but i suck at vb well i will apreciate the help ty!

Moving An Image
how do i make an image move?

Image Moving
I have an image control on a form, and I'm trying to get it to move.

I want the user to be able to either click/drag it to anywhere on the form, but can't get the right event/code combination. Anybody know how to move an image during run-time?

Thanx.

Moving An Image
hello all,

i m trying to drag an image from a specific place on the form,
and drop it on another .

how can i do that?

tnx
LirLir

Moving An Image Everywhere
can someone please help me i need to know how to move an image in all directions randomly such as right left up diagonally ect (RANDOMLY) please

Moving Image So It Goes Everywhere
i need it so when i press go ..
the image will move randomly everywhere

such as a bird.. so when i press go the bird will fly down up left right diagonally and it will do it randomly

PLEASE HELP ME

Moving Image Help
Hi everybody!
can anyone tell me agood way of making an image float randomly around the screen? i've tried 'do until ' and 'if then' without getting the results I want.
Thanks in advance for any suggestions.

Moving An Image
Thanks to the guy who helped me move the image around the screen by using the keys but i have another problem. How do i make it so that when the user presses the keyboards left arrow, the image moves left but changes to another image. e.g.

i want to move the elephant image left
when i press left i want to move the image but change the image to one that is of an elephant facing left

how do i do this with al the arrow keys?

Moving Image W/ Mouse
I wanted to have an image move according to the mouse cursor. I've managed to do that with a mousemove procedure on the form. However, the image moves fine on the right side of the screen, but the image doesn't move so smooth on the left side. I'm not sure why there would be a difference, and I cannot change the effect.

Moving Image- Flashes
Hi,

I've got a very simple program, where a image in VB moves around the screen. To get it to move smoothly, i've put a timer on at 1ms, and it moves 1 pixel every ms. It works great.
However, the image "flashes" as it moves- black lines appear down it- like watching a TV screen through a camera. I've tried changing it to 10ms, 10 pixels, etc, but that doesn't really help much, since it is jerky.

Moving Image Too Fast...
Im working on a game that sets a image's position every 500
milaseconds, it works fine just looks well.... dumb... it shows the image move over then down kinda like streaking it to its position, I think bitblit will fix this but id rather not get into all that if there is an easyer way and yes it is very inportent that it sets the position every 500 milaseconds

Image Loading/moving
I was wondering if there is a way to load or move an image from a different form.

For example, if I have a picture in Form2.frm and I want to be able to display that image in Form1.frm at different times during the program, what would I do? I want to do this so that I can just store all my pictures in a form separate from my game and just call the images whenever needed.

Any help is appreciated.
Thanks.

Moving An Image With The Mouse
hey all, just wondering if anyone could point me in the direction of moving an image by clicking on it, and while holding the mouse button down and moving it in any direction, how to change the properties of the image(in this case, the .left, or .top properties)
Thanks in advance.

Image Moving On Keypress
2 questions.. # 1, is there a KeyAscii for the arrow up down right left keys??


and #2, when i make Image1.left = image1.left - 25 , it moves but it flashes. Thats very annoying and ugly, ive tried transparent and not transparent, it always flashes. is there a way so it moves without flashing???

Making A Moving Image Go The Other Way?
Hey, Ive got an image moving around on my screen using option buttons, (up down left right) and I want, when it gets to a certain point, to go the other way. So say up is selected and it gets to y 3180 I want it to start going down. Ive had a go at the coding on the 5th line but it doesnt work, the other 4 do though. Can anyone help please? thanks

Private Sub Timer_Timer()

Dim original As Single


If OptDown.Value = True Then
ImgCross.Top = ImgCross.Top + 50
End If

If OptUp.Value = True Then
ImgCross.Top = ImgCross.Top - 50
End If

If OptLeft.Value = True Then
ImgCross.Left = ImgCross.Left - 50
End If

If OptRight.Value = True Then
ImgCross.Left = ImgCross.Left + 50
End If



If ImgCross.Top = 3180 Then
OptUp.Value = False
ImgCross.Top = ImgCross.Top - 50
End If

End Sub

Moving An Image Up On Click
Im making a helicopter type game, and i want the helicopter to rise when i click the left button on the mouse. Also, i would like the helicopter to fall when the left button on the mouse isnt being clicked. My image name is helionclick. Im using vb 6.

Moving Image On Vb Form
hi all,

i want to add a image on vb form but not a static image .image like..
example: when we copy a folder and then paste somewhere moving
image of copying process.
anybody can help me.

thanks ,
abhishek mishra

Copyright © 2005-08 www.BigResource.com, All rights reserved