Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42220

Move Object Left

$
0
0
I want my lbl to move to the left every tick but I want the new number to be centered.

Code:
Code:

Public Class frmGame
    Dim Rand As Random = New Random
    Dim BallNumber As Integer

    Private Sub BingoTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BingoTimer.Tick
        Dim x As Integer = (Me.ClientRectangle.Width / 2) - (lblNumber.Text.Length + BallNumber.ToString.Length)
        BallNumber = Rand.Next(1, 100)
        lblNumber.Text = lblNumber.Text + " " + BallNumber.ToString
        lblNumber.Location = New Point(x, lblNumber.Location.Y)
    End Sub

    Private Sub frmGame_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        BingoTimer.Start()
    End Sub
End Class

Basicly I need to get my x value to only move left.

Viewing all articles
Browse latest Browse all 42220

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>