|
-
Jul 15th, 2000, 11:45 AM
#1
Thread Starter
Addicted Member
you know how in vb you have the the toolbar and you csn make it stik to the side . How can i do that in my project just making it stay on the side , if you can help me thank you.
WHat would we do with out Microsoft.
A lot more.
-
Jul 15th, 2000, 11:55 AM
#2
You mean dock a window?
Code:
Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Dim StartMenu As Long
Dim What As RECT
Public Sub BorderToRight(FormName As Form)
For TempNum = 1 To 999
TempString$ = Space$(128)
TempNum2 = GetClassName(TempNum, TempString$, 128)
TempNum3 = Left$(TempString$, TempNum2)
If LCase(TempNum3) = "shell_traywnd" Then GoTo StartMenuFound
Next TempNum
StartMenuFound:
GetWindowRect TempNum, What
StartMenu = What.Top * 15
FormName.Move Screen.Width - FormName.Width, 0, FormName.Width, StartMenu
End Sub
Usage: Call BorderToRight(Me)
-
Jul 15th, 2000, 12:32 PM
#3
Thread Starter
Addicted Member
no no i mean liek its lke a magnet it like go to the side if it it like 50pix away then it like magnets to the side like winamp when you bring the playlist close to one of the other windows it like locks the winodws together
WHat would we do with out Microsoft.
A lot more.
-
Jul 15th, 2000, 01:49 PM
#4
this will make the form move to the left side of the screen if it is within 1000 pixels away
Code:
Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 50
End Sub
Private Sub Timer1_Timer()
If Me.Left < 1000 Then Me.Left = 0
If Me.Left < 1000 Then Exit Sub
End Sub
if flickers a little bit though
-
Jul 15th, 2000, 04:44 PM
#5
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
|