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




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.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
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

Intersect (hits Point)
Hay

In my game i us d3dx.Intersect and everything wokr good but I wont know where my ray hit. How I can find hit piont(x,y,z).

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

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.

Making A Line Graph 1 Point Instead Of 2 Point???
Hi

I have a line graph which appears in 2 point. The MSChart property pages are of no help in making this line 1 point(as the line is created by code) so how can I code it?

Thanks

How To Stop Or Pause A Function And Restart It From The Point Where Stopped?
Is there a simple way in Visual BAsic to Stop a function and then again start from the point it was stopped?

Example

User presses Start->

Start_OnClick()

Function 1
Function 2
Function 3

User presses Next ->

and Function 4
Function 5

should be continued...??????

Moving A Point In A Circle Pattern?
howdy,

im definitely no math wiz, and ive spent a long time trying to figure this out.

what im looking for is a quick equation to make a point move in a perfect circle.

looking for an equation that i can put into a variable.

thanks




Edited by - DragonWraith on 8/18/2004 4:07:37 PM

Moving To Next Slide In Power Point
Hi,

I have a written a very basic game based on 'Who wants to be a millionaire', where the user inputs there own questions using a form.

Now I know this is possible, because I've seen it done, does anyone know the code attached to a spin button to move either to the next slide or to the previous, without being in a presentation.

Also is it possible to enter user inputted data, into a textbox on a website, in this case google, and then get google to query the search automatically? I just need to know if that is possible for now.

Any help appreciated as I am fairly new to code.

Tim

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

Stop An Application Resizing, Past A Certain Point, Flicker Free? [slvd]
How can i make my form, not resize past say

Height = 8000 and width = 9500 widthout it flickering if the person tries to minimize it further?

I Dont mind how wide it goes, but i dont want it any smaller then this size???

Is there a flicker-free method?

MS Chart - Data Point Label
In MS Chart control (Graph) how to set and get the Data Point Label property ?


I want to display the values of each bar (series), near by it.

Thanks.

Moving Insertion Point With Mouse Cursor In RichTextBox
Does anybody know how to track/move the insertion point in a RichTextBox with the mouse cursor? For instance, as I move the cursor over nodes in a treeview control that has HotTracking turned on the node highlights/selects.

This is basically what I'd like to accomplish in a RTB control. As the mouse moves over the contents of the RTB control, I'd like the insertion point to move with the cursor.

Any help would be greatly appreciated. Thanks.

Move To A Point? ***(UNSOLVED)*** Meaning That Its Not Solved
I am creating a simple RTS game...
I am working in Visual Basic 6 with Timers

I want to know how to move my unit to a waypoint

I have a unit
when a waypoint is set I have a function that checks the distance between the two points. now I have another funtion that is used for moving my object to the waypoint so what I did is assigned a 3rd postion using the X postion of my unit and the Y postion of my waypoint, so now I have a right angle triagnle whee!

Now what I need is to calculate the angle to the waypoint and then tell the unit to move there at the speed set by the timer... now how can I do that...

can anyone help me to move it...


VB Code:
Dim pos_X1, pos_Y1, pos_X2, pos_Y2, pos_X3, pos_Y3, hyp, opp As DoublePrivate Sub SetCharacter(unit As Shape, unit_radius As Shape) unit.Left = 2500unit.Top = 2500 unit_radius.Left = (unit.Left + (unit.Width / 2)) - (unit_radius.Width / 2)unit_radius.Top = (unit.Top + (unit.Height / 2)) - (unit_radius.Height / 2) End SubPrivate Function Distance(postion1, postion2 As Shape)'//This Function Finds the distance between two points and returns the value pos_X1 = postion1.Left + (postion1.Width / 2)pos_Y1 = postion1.Top + (postion1.Height / 2) pos_X2 = postion2.Left + (postion2.Width / 2)pos_Y2 = postion2.Top + (postion2.Height / 2) Distance = Sqr((pos_X1 - pos_X2) ^ 2) + ((pos_Y1 - pos_Y2) ^ 2) End FunctionPrivate Function MoveUnit(postion1, postion2 As Shape) pos_X1 = postion1.Left + (postion1.Width / 2)pos_Y1 = postion1.Top + (postion1.Height / 2) pos_X2 = postion2.Left + (postion2.Width / 2)pos_Y2 = postion2.Top + (postion2.Height / 2) pos_X3 = pos_X1pos_Y3 = pos_Y2 hyp = Distance(postion1, postion2)opp = Sqr((pos_X2 - pos_X3) ^ 2) + ((pos_Y2 - pos_Y3) ^ 2)MoveUnit = Sin(opp / hyp) End Function Private Sub Form_Load() Call SetCharacter(worker1, worker1_radius)text = MoveUnit(worker1, waypoint1) End Sub

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

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

*solved* How To Stop Looping?
Hi this code finds what i want then keeps going..... how to stop when found?Code:Set rs = New ADODB.Recordset 'this will be the rs
Dim strSQL As String 'this the source
strSQL = "Select REG, ID From ZZ WHERE ID = 1" 'Get all records from tblExample
    rs.Open strSQL, oConnection, adOpenStatic, adLockBatchOptimistic, adCmdText
    Do Until rs.EOF
        If (rs("REG") = FTest.txtEnigma) Then
            FTest.Visible = False
            Form1.Visible = True
        ElseIf (rs("REG") <> FTest.txtEnigma) Then
            Form1.Visible = False
            FTest.Visible = True
        End If
    DoEvents
    rs.MoveNext
    
    Loop
    rs.Close 'Close the recordset never leave it open!
    Set rs = Nothing 'clear the rs variable
Or ZZ.REG = null aswell?
I tried to writeCode: strSQL = "Select REG, ID From ZZ WHERE ID = 1" 'Get but to no Avail....hmmmmmm

---------------------------------------------------------------------------------------------------------------------------------
Todays random quote: I am still determined to be cheerful and happy, in whatever situation I may be; for I have also learned from experience that the greater part of our happiness or misery depends upon our dispositions, and not upon our circumstances.

Martha Washington (1732 - 1802)
---------------------------------------------------------------------------------------------------------------------------------

Edited by - Hopeless on 2/29/2004 7:01:59 PM

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 ?



(NOT SOLVED)How Do I Stop To Uninstall My Application?
Hi!


We our company sales a computers , we allowed our customers to pay the money with in 3 months, so most of the consumers do not pay the money with the exect period , so My manager asked me to develop a program that can force the customer to contact us as soon as the time over. Fortunety I have developed the exect package.

Now my question is the ,users can uninstall the package.How Can I stop to uninstall the package from the clients computer?


Thak you in advance.



Edited by - Dayib12 on 11/26/2005 11:04:08 PM

How To Stop Label Controls From Flickering?
I'm working on a little app that involves a loop statement that updates a label control very frequently (around 3000 times). Everything works, except for the fact that it flickers. I was wondering if there was any way to stop it.


EXAMPLE:


Code:
For X = 1 to 3000
lblLabel.caption = X & "files found"
Next X

Stop Label In Timer From Flikkering!
Hello.

I have a number of labels in a timer. Is there any way I can stop them from flikkering. I cannot use picture boxes because I need the captions to be changed in my program. Is there anyway I can BitBlt. I tried but it didnt seem to work.

Many thanks chris

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?

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??

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.

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 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

Moving A Picture Box With Keys? *SOLVED*
Is it possible to move an image within a picturebox? I need to move it left and right.

If KeyCode = vbKeyLeft Then Image2.Left = Image2.Left - 1
If KeyCode = vbKeyRight Then Image2.Right = Image2.Right + 1

This is not working!!

MOVING TO NEXT NODE In A Treeview (solved)
How to determine if SOMETHING is selected in a treeview?

THIS IS THE QUESTION OF THE OLD TOPIC NAME SEE LAST POST

[Solved] : Moving Controls In Frames
Hello,
I have a tabstrip, in which i got a DataGrid placed inside a frame. I also have a listview that i display in ButtonClick event of DataGrid.
This ListView is placed at the bottom of the column of the DataGrid in which user clicked the button.
Problem is that when listview control is displayed while at last row (this row is close to border of the frame), part of a listview hides away in the Frame control.
If i keep Listview control out of Frame (now only grid is inside Frame), then i can'y find the correct coordinates to place listview at bottom of the Column.
Thanx in anticipation

Aashu

Edited by - sudhanshuXP on 4/28/2005 12:42:43 AM

Making A MsgBox Stop A Timer
Hi

I'm sure many of you know that when a msgbox is active from inside Visual Basic's "Test Runtime" environment, any timers that happen to be running are stopped. However, this is not the case during a compiled EXE's runtime, whereby the timers just carry on.

Is there a way to stop a timer when a msgbox (called from within the timer itself) is active?

Thanks!

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.

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