|
-
Dec 28th, 2002, 08:56 AM
#1
Thread Starter
Fanatic Member
make a porton of the form "draggable"
I decided to manually skin my app:

The top bar, I don't know how to make it so when you hold your mouse on it, you can adjust it.
Any ideas?
It's a ShapeBox, and the images on top are image boxes. I can make adjustments easily. Thanks
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
-
Dec 28th, 2002, 09:02 AM
#2
-= B u g S l a y e r =-
VB Code:
Option Explicit
Private Declare Function SendMessage Lib "User32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Sub ReleaseCapture Lib "User32" ()
Const WM_NCLBUTTONDOWN = &HA1
Const HTCAPTION = 2
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim lngReturnValue As Long
If Button = vbLeftButton Then
Call ReleaseCapture
lngReturnValue = SendMessage(Form1.hWnd, WM_NCLBUTTONDOWN, _
HTCAPTION, 0&)
End If
End Sub
makes it possible to move a form without a titlebar.
you need a hwnd, the shape and the images do not have that... not sure how to solve that..
you could paint the title bar onto the form directly, then you could use the sample above directly
-
Dec 28th, 2002, 09:37 AM
#3
Thread Starter
Fanatic Member
hmm thanks, ill play with it and see what i can do
Last edited by nabeels786; Dec 28th, 2002 at 09:56 AM.
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
-
Dec 28th, 2002, 09:52 AM
#4
-
Dec 28th, 2002, 09:57 AM
#5
Thread Starter
Fanatic Member
thanks 
i decided to put it in a label, i expanded it to its big enough, didnt do anything when i tried to drag it, it just snaps to the mouse position. the drag events are only if something is dragged over it right? or is the oledrag? i havent used vb in a while..lol
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
-
Dec 28th, 2002, 10:12 AM
#6
-
Dec 28th, 2002, 10:13 AM
#7
-= B u g S l a y e r =-
urk... was a bit bigger than expected... 
here, I uploaded it : http://www.pvp.no/vbw/move a boarderless form.zip
-
Dec 28th, 2002, 10:14 AM
#8
Thread Starter
Fanatic Member
ohhhhhhhhhhhhhhh i see what you mean now. lemme try that out
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
-
Dec 28th, 2002, 10:21 AM
#9
Thread Starter
Fanatic Member
alrighty, sweet it working, thanks man
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
-
Dec 28th, 2002, 10:26 AM
#10
-= B u g S l a y e r =-
yay!
-
Dec 28th, 2002, 11:14 AM
#11
-= B u g S l a y e r =-
How did you skin those buttons? or is it pictureboxes ?
-
Dec 28th, 2002, 11:45 AM
#12
Thread Starter
Fanatic Member
picture boxes
i made the images in fireworks, and then just added them in
the frames were shapes, and i just added the text in.
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
-
Dec 28th, 2002, 11:54 AM
#13
Originally posted by peet
makes it possible to move a form without a titlebar.
you need a hwnd, the shape and the images do not have that... not sure how to solve that...
I guess this is solved already, but I just thought I'd point out that only the form/control to be dragged needs an hWnd. The control you are using to drag it only needs to have a MouseMove event. You're still stuck on the shape control, since it doesn't have any events at all, but you can do this...
VB Code:
Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim lngReturnValue As Long
If Button = vbLeftButton Then
Call ReleaseCapture
lngReturnValue = SendMessage(Form1.hWnd, WM_NCLBUTTONDOWN, _
HTCAPTION, 0&)
End If
End Sub
...with an imagebox and it will work.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Dec 28th, 2002, 12:38 PM
#14
Thread Starter
Fanatic Member
thanks blade. i did the code onto the imagebox that's the background nad then the label which is the title, so if you click in "idle" space itll be moveable
thanks guys
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
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
|