This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-09-28 17:51:07

SeptimusHeap
Scratcher
Registered: 2010-02-01
Posts: 1000+

VB Problem!

It should move the text to the mouse position, but it doesn't! Help!


Label2.Location = MousePosition - Me.Location


http://i46.tinypic.com/dw7zft.png

Offline

 

#2 2010-09-28 17:52:05

Usatt1337
Scratcher
Registered: 2008-08-27
Posts: 500+

Re: VB Problem!

http://files.myopera.com/GuiltyGear/albums/3589862/pancake-bunny.jpgBut seriously, explain, what?

Last edited by Usatt1337 (2010-09-28 17:57:04)


http://img534.imageshack.us/img534/9183/fmod.jpg

Offline

 

#3 2010-09-28 17:54:04

SeptimusHeap
Scratcher
Registered: 2010-02-01
Posts: 1000+

Re: VB Problem!

Me.Size = New Point(Me.Location.X - MousePosition.X, Me.Size.Height)
Label2.Location = MousePosition - Me.Location

Anyway, this is supposed to resize the form to the mouse position, when the function is called, but it doesn't work!


http://i46.tinypic.com/dw7zft.png

Offline

 

#4 2010-09-28 17:56:41

Sunrise-Moon
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: VB Problem!

Usatt1337 wrote:

http://humour.200ok.com.au/img/pancake_bunny.jpgBut seriously, explain, what?

What does eating kittens have to do with the thread? AKA quoted for proof


http://i1067.photobucket.com/albums/u427/HulKDzN/RebornBlade.png

Offline

 

#5 2010-09-28 17:57:36

Usatt1337
Scratcher
Registered: 2008-08-27
Posts: 500+

Re: VB Problem!

Sunrise-Moon wrote:

Usatt1337 wrote:

http://humour.200ok.com.au/img/pancake_bunny.jpgBut seriously, explain, what?

What does eating kittens have to do with the thread? AKA quoted for proof

I meant to copy and paste the pancake bunny, but, idk what went wrong lol.


http://img534.imageshack.us/img534/9183/fmod.jpg

Offline

 

#6 2010-09-28 17:58:16

SeptimusHeap
Scratcher
Registered: 2010-02-01
Posts: 1000+

Re: VB Problem!

Can someone actually HELP?


http://i46.tinypic.com/dw7zft.png

Offline

 

#7 2010-09-28 17:58:41

Aidan
Scratcher
Registered: 2007-06-15
Posts: 1000+

Re: VB Problem!

Usatt1337 wrote:

Sunrise-Moon wrote:

Usatt1337 wrote:

http://humour.200ok.com.au/img/pancake_bunny.jpgBut seriously, explain, what?

What does eating kittens have to do with the thread? AKA quoted for proof

I meant to copy and paste the pancake bunny, but, idk what went wrong lol.

That happened to me too. It's the first image on Google Images. It's a hotlinking image. It changes once you link it.

Offline

 

#8 2010-09-28 18:01:20

SeptimusHeap
Scratcher
Registered: 2010-02-01
Posts: 1000+

Re: VB Problem!

SeptimusHeap wrote:

Can someone actually HELP?

A
|-- big_smile \

Smiley says read it.


http://i46.tinypic.com/dw7zft.png

Offline

 

#9 2010-09-28 18:01:34

Aidan
Scratcher
Registered: 2007-06-15
Posts: 1000+

Re: VB Problem!

SeptimusHeap wrote:

Can someone actually HELP?

I don't know VB. I hope to learn it though.  smile  But sorry, I can't help.  hmm

Offline

 

#10 2010-09-28 18:05:06

kimmy123
Scratcher
Registered: 2008-05-20
Posts: 1000+

Re: VB Problem!

SeptimusHeap wrote:

/ sad \
aa/\


http://i.imgur.com/Mg3TPIE.pnghttp://i.imgur.com/rgyzXV5.pnghttp://i.imgur.com/685FKVd.pnghttp://24.media.tumblr.com/8678e33865664f328e1654109679cb92/tumblr_mm1qu3jGD71s8caito3_r1_250.gif

Offline

 

#11 2010-09-28 20:38:58

soupoftomato
Scratcher
Registered: 2009-07-18
Posts: 1000+

Re: VB Problem!

Idont.know-vbasic=lolwut


I'm glad to think that the community will always be kind and helpful, the language will always be a fun and easy way to be introduced into programming, the motto will always be: Imagine, Program, Share - Nomolos

Offline

 

#12 2010-09-29 07:12:53

SeptimusHeap
Scratcher
Registered: 2010-02-01
Posts: 1000+

Re: VB Problem!

Bump


http://i46.tinypic.com/dw7zft.png

Offline

 

#13 2010-09-29 07:53:05

what-the
Scratcher
Registered: 2009-10-04
Posts: 1000+

Re: VB Problem!

I would help you as I used this for screensaver. Too bad it's on another computer. There's this THING called Google.

http://www.google.com.au/#hl=en&source=hp&biw=1440&bih=743&q=vb.net+change+mouse+position&btnG=Google+Search&aq=f&aqi=&aql=&oq=vb.net+change+mouse+position&gs_rfai=&fp=f58fe64ac2ffe34f


http://imageshack.us/m/64/9034/ddfss.pngMy site
Find someone post count. Click posts under username. Find number of pages. Times that by 40 for min and 60 for max and you have a rough estimate of post count.

Offline

 

#14 2010-09-29 08:15:42

SeptimusHeap
Scratcher
Registered: 2010-02-01
Posts: 1000+

Re: VB Problem!

Me wrote:

Me.Size = New Point(Me.Location.X - MousePosition.X, Me.Size.Height)
Label2.Location = MousePosition - Me.Location

Anyway, this is supposed to resize the form to the mouse position, when the function is called, but it doesn't work!

...

I don't want to move the mouse...


http://i46.tinypic.com/dw7zft.png

Offline

 

#15 2010-09-29 08:27:58

what-the
Scratcher
Registered: 2009-10-04
Posts: 1000+

Re: VB Problem!

Public Class Form1


    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Label2.Location = MousePosition - Me.Location
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Enabled = True
    End Sub
End Class


Add A Timer to your application to update the label position. Note. It isn't recommened that the label be under the mouse otherwise you can't click things.

Last edited by what-the (2010-09-29 08:28:42)


http://imageshack.us/m/64/9034/ddfss.pngMy site
Find someone post count. Click posts under username. Find number of pages. Times that by 40 for min and 60 for max and you have a rough estimate of post count.

Offline

 

#16 2010-09-29 10:07:19

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: VB Problem!

Like he said.

Or: Set the object's position's Left to the mousex and the Top to mousey.


Hai.

Offline

 

#17 2010-09-29 16:46:22

SeptimusHeap
Scratcher
Registered: 2010-02-01
Posts: 1000+

Re: VB Problem!

I tried this:

Code:

Private Sub Label2_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label2.MouseDown
        Me.Size = New Point(Me.Location.X - MousePosition.X, Me.Size.Height)
        Label2.Location = MousePosition - Me.Location
    End Sub

But it doesn't work! It's supposed to resize the form!


http://i46.tinypic.com/dw7zft.png

Offline

 

#18 2010-09-29 16:48:12

Arcas
Scratcher
Registered: 2010-05-04
Posts: 32

Re: VB Problem!

Sounds complicated.
Son, I am supprised.

Offline

 

#19 2010-09-29 18:56:22

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: VB Problem!

SeptimusHeap wrote:

I tried this:

Code:

Private Sub Label2_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label2.MouseDown
        Me.Size = New Point(Me.Location.X - MousePosition.X, Me.Size.Height)
        Label2.Location = MousePosition - Me.Location
    End Sub

But it doesn't work! It's supposed to resize the form!

Can you explain? When you click Label2, what is supposed to happen?


Hai.

Offline

 

#20 2010-09-29 19:26:48

SeptimusHeap
Scratcher
Registered: 2010-02-01
Posts: 1000+

Re: VB Problem!

You're supposed to be able to resize the form when you drag form1.


http://i46.tinypic.com/dw7zft.png

Offline

 

#21 2010-09-29 21:55:22

what-the
Scratcher
Registered: 2009-10-04
Posts: 1000+

Re: VB Problem!

SeptimusHeap wrote:

You're supposed to be able to resize the form when you drag form1.

But you can have the form setting on "sizable" to do that.


http://imageshack.us/m/64/9034/ddfss.pngMy site
Find someone post count. Click posts under username. Find number of pages. Times that by 40 for min and 60 for max and you have a rough estimate of post count.

Offline

 

#22 2010-09-29 23:44:56

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: VB Problem!

That's what I was gonna say...  hmm


Hai.

Offline

 

#23 2010-09-30 07:05:09

SeptimusHeap
Scratcher
Registered: 2010-02-01
Posts: 1000+

Re: VB Problem!

Yeah, well... The form is a 'splashscreen' type, I did that so it wouldn't look like a window, just a box.


http://i46.tinypic.com/dw7zft.png

Offline

 

#24 2010-10-01 07:13:30

SeptimusHeap
Scratcher
Registered: 2010-02-01
Posts: 1000+

Re: VB Problem!

Bu-whatever...


http://i46.tinypic.com/dw7zft.png

Offline

 

Board footer