Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Here's my code;

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

If X 375 And X 375 And Y 750 And X 750 And Y 1125 And X 1125 And Y 1500 And X 1500 And Y < 1875 Then

Shape1.Left = 1440

Shape1.Top = 1440

End If

End Sub

I have a shape on the form so when the mouse moves the shape follows it. But I want the shape to move by jumps. Like a grid, the shape is a square. Is there a faster way to do this then the way above? Is so, let me know. Thanks!

-Joel

• Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

If X 375 And X375 And Y750 And X750 And Y1125 And X1125 And Y1500 And X1500 And Y<1875 Then<br>
Shape1.Left = 1440

Shape1.Top = 1440

End If

End Sub

• Member Posts: 0

_________ / http://forcoder.org / free ebooks and video tutorials about // Python, Ruby, PL/SQL, C++, Objective-C, R, Java, C#, MATLAB, Delphi, Visual Basic .NET, Swift, Perl, Go, Visual Basic, C, Scratch, PHP, Assembly, JavaScript FoxPro, Prolog, Dart, Clojure, Alice, F#, Lua, ML, Rust, D, Awk, Ada, SAS, Julia, ABAP, Erlang, Hack, Apex, Crystal, Scala, COBOL, Logo, Scheme, LabVIEW, Transact-SQL, Lisp, Bash, Kotlin, VBScript, Fortran // _________