|
-
Nov 14th, 2000, 10:22 PM
#1
Thread Starter
Frenzied Member
I currently have this code:
Code:
If frm1.Left = frm2.Left + frm2.Width Then
End
End If
that code makes it so that the program ends when form 1 is exactly to the right side of form 2 it ends. how to i make it so that if its in range of about 100, it will still end
i hope my question was clear
thanks in advance
NXSupport - Your one-stop source for computer help
-
Nov 15th, 2000, 12:15 AM
#2
transcendental analytic
If you use End, some objects may not be unloaded correctly so don't use it. Unless you have a lot of modulebound objects, unload both forms, or any forms with unload statement, but if you have other objects in a module unload them first.
To catch and close even if you are within 100 twips (i guess) you just test the range:
If 100 < abs(frm2.Left + frm2.Width -frm1.Left) Then
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Nov 15th, 2000, 03:22 PM
#3
Thread Starter
Frenzied Member
thanks, but that didn't work for me, this is my code:
Code:
Dim lngReturnValue As Long
If Button = 1 Then
Call ReleaseCapture
lngReturnValue = SendMessage(frmMain.hwnd, WM_NCLBUTTONDOWN, _
HTCAPTION, 0&)
If 1 < Abs(frmMP3.Left + frmMP3.Width - frmMain.Left) Then
MsgBox "You're Close"
End If
End If
and any where every you move the form on the screen the message box pops up and i have 1600*1200 and the same thing happened when i put the 100 to 1 the same thing happens
NXSupport - Your one-stop source for computer help
-
Nov 15th, 2000, 03:36 PM
#4
What even are you placing this code in? MouseDown? Or MouseMove?
-
Nov 15th, 2000, 03:37 PM
#5
Thread Starter
Frenzied Member
NXSupport - Your one-stop source for computer help
-
Nov 15th, 2000, 03:59 PM
#6
Hyperactive Member
Try This
Code:
If 0 < (frmMP3.Left + frmMP3.Width - frmMain.Left) And 100 > (frmMP3.Left + frmMP3.Width - frmMain.Left) Then
MsgBox "You're Close"
-
Nov 16th, 2000, 09:15 PM
#7
Thread Starter
Frenzied Member
NXSupport - Your one-stop source for computer help
-
Nov 16th, 2000, 09:42 PM
#8
transcendental analytic
why did you replace 100 with 1? remember we're talking about twips
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Nov 16th, 2000, 10:10 PM
#9
Thread Starter
Frenzied Member
i tired it with 100 and it didn't work
NXSupport - Your one-stop source for computer help
-
Nov 16th, 2000, 10:23 PM
#10
transcendental analytic
Are you sure you tried to attach the right side of the frm2 to the left side of frm1?
Are you sure the event you have the code in fires?
Are you sure the formnames are spelled correctly?
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|