how can i put a label random position on my screen
for exemple when start the app show
10% top 10% left
or 20% top
etc
random
its possible?
for exemple when start the app show
10% top 10% left
or 20% top
etc
random
its possible?
Dim lado,alto As Int
lado = GetDeviceLayoutValues.Width
alto = GetDeviceLayoutValues.Height
r1 = Rnd(0,lado)
r2 = Rnd(0,alto)
Label1.Left = r1
Label1.top = r2
The label will disappear or look incomplete in case the number is zero.Just limit the width and height so the label doesn't disappear off the screen:
B4X:r1 = Rnd(0,lado - Label1.Width) r2 = Rnd(0,alto - Label1.Height)
The label will disappear or look incomplete in case the number is zero.